@tencentcloud/sdk-mcp 1.2.5 → 1.2.7

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 (370) hide show
  1. package/package.json +1 -1
  2. package/resource/doc/chatuikit/faq/common/server_error_code.md +74 -0
  3. package/resource/doc/chatuikit/faq/{freq_qa.md → native_sdk/faq.md} +2 -1
  4. package/resource/doc/chatuikit/faq/web_sdk/error_code.md +47 -0
  5. package/resource/doc/chatuikit/faq/web_sdk/faq.md +115 -0
  6. package/resource/doc/chatuikit/flutter/faq.md +117 -0
  7. package/resource/doc/chatuikit/iOS/faq.md +117 -0
  8. package/resource/doc/chatuikit/react/faq.md +26 -0
  9. package/resource/doc/chatuikit/vue/faq.md +35 -0
  10. package/resource/doc/livekit/faq/common/error_code.md +89 -0
  11. package/resource/doc/roomkit/common/error_code.md +67 -0
  12. package/resource/doc/rtcengine/faq/common/userSig.md +309 -0
  13. package/resource/doc/rtcengine/faq/{web.md → web/web.md} +2 -2
  14. package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
  15. package/resource/doc/rtcengine/web/{how_to_integrated_web_rtc_engine.md → how_to_integrated_web_sdk.md} +7 -2
  16. package/resource/doc/rtcengine/web/{how_to_run_web_rtc_engine_demo.md → how_to_run_web_sdk_demo.md} +1 -1
  17. package/resource/doc/tuicallkit/android/faq.md +1000 -0
  18. package/resource/doc/tuicallkit/faq/common/error_code.md +47 -0
  19. package/resource/doc/tuicallkit/flutter/faq.md +981 -0
  20. package/resource/doc/tuicallkit/{faq → iOS}/faq.md +0 -72
  21. package/resource/doc/tuicallkit/react/faq.md +986 -0
  22. package/resource/doc/tuicallkit/vue/faq.md +986 -0
  23. package/tools/call/get-native-call-integration.js +4 -10
  24. package/tools/call/get-native-call-integration.js.map +1 -1
  25. package/tools/call/get-web-call-api.js +4 -7
  26. package/tools/call/get-web-call-api.js.map +1 -1
  27. package/tools/call/get-web-call-integration.js +4 -9
  28. package/tools/call/get-web-call-integration.js.map +1 -1
  29. package/tools/chat/get-native-chat-integration.js +4 -8
  30. package/tools/chat/get-native-chat-integration.js.map +1 -1
  31. package/tools/chat/get-web-chat-component-detail.js +5 -10
  32. package/tools/chat/get-web-chat-component-detail.js.map +1 -1
  33. package/tools/chat/get-web-chat-integration.js +4 -12
  34. package/tools/chat/get-web-chat-integration.js.map +1 -1
  35. package/tools/chat/get-web-chat-uikit-init.js +5 -6
  36. package/tools/chat/get-web-chat-uikit-init.js.map +1 -1
  37. package/tools/chat/get-web-chat-window-integration.js +4 -12
  38. package/tools/chat/get-web-chat-window-integration.js.map +1 -1
  39. package/tools/chat/{create-group.js → get-web-create-group-doc.js} +5 -6
  40. package/tools/chat/get-web-create-group-doc.js.map +1 -0
  41. package/tools/common/get-faq.js +93 -0
  42. package/tools/common/get-faq.js.map +1 -0
  43. package/tools/common/get-usersig.js +9 -18
  44. package/tools/common/get-usersig.js.map +1 -1
  45. package/tools/common/present-framework-choice.js +3 -10
  46. package/tools/common/present-framework-choice.js.map +1 -1
  47. package/tools/common/record-prompt.js +5 -12
  48. package/tools/common/record-prompt.js.map +1 -1
  49. package/tools/common/record-result.js +7 -11
  50. package/tools/common/record-result.js.map +1 -1
  51. package/tools/definitions/get_faq_def.js +28 -0
  52. package/tools/definitions/get_faq_def.js.map +1 -0
  53. package/tools/definitions/get_native_call_uikit_integration_def.js +21 -0
  54. package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -0
  55. package/tools/definitions/get_native_chat_uikit_integration_def.js +21 -0
  56. package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -0
  57. package/tools/definitions/get_usersig_def.js +34 -0
  58. package/tools/definitions/get_usersig_def.js.map +1 -0
  59. package/tools/definitions/get_web_call_uikit_api_def.js +23 -0
  60. package/tools/definitions/get_web_call_uikit_api_def.js.map +1 -0
  61. package/tools/definitions/get_web_call_uikit_integration_def.js +20 -0
  62. package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -0
  63. package/tools/definitions/get_web_chat_uikit_component_detail_def.js +24 -0
  64. package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -0
  65. package/tools/definitions/get_web_chat_uikit_init_def.js +23 -0
  66. package/tools/definitions/get_web_chat_uikit_init_def.js.map +1 -0
  67. package/tools/definitions/get_web_chat_uikit_integration_def.js +26 -0
  68. package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -0
  69. package/tools/definitions/get_web_chat_window_integration_def.js +26 -0
  70. package/tools/definitions/get_web_chat_window_integration_def.js.map +1 -0
  71. package/tools/definitions/get_web_create_group_doc_def.js +18 -0
  72. package/tools/definitions/get_web_create_group_doc_def.js.map +1 -0
  73. package/tools/definitions/get_web_live_state_detail_def.js +19 -0
  74. package/tools/definitions/get_web_live_state_detail_def.js.map +1 -0
  75. package/tools/definitions/get_web_live_uikit_component_detail_def.js +21 -0
  76. package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +1 -0
  77. package/tools/definitions/get_web_room_state_detail_def.js +19 -0
  78. package/tools/definitions/get_web_room_state_detail_def.js.map +1 -0
  79. package/tools/definitions/present_framework_choice_def.js +24 -0
  80. package/tools/definitions/present_framework_choice_def.js.map +1 -0
  81. package/tools/definitions/record_prompt_def.js +22 -0
  82. package/tools/definitions/record_prompt_def.js.map +1 -0
  83. package/tools/definitions/record_result_def.js +22 -0
  84. package/tools/definitions/record_result_def.js.map +1 -0
  85. package/tools/index.js +13 -11
  86. package/tools/index.js.map +1 -1
  87. package/tools/live/get-web-live-component-detail.js +5 -7
  88. package/tools/live/get-web-live-component-detail.js.map +1 -1
  89. package/tools/live/get-web-live-state-detail.js +5 -7
  90. package/tools/live/get-web-live-state-detail.js.map +1 -1
  91. package/tools/room/get-web-room-state-detail.js +5 -7
  92. package/tools/room/get-web-room-state-detail.js.map +1 -1
  93. package/tools/rtcengine/get-rtcengine-web-sdk-integration.js +28 -0
  94. package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +1 -0
  95. package/tools/rtcengine/get-trtc-sdk-faq.js +32 -0
  96. package/tools/rtcengine/get-trtc-sdk-faq.js.map +1 -0
  97. package/tools/rtcengine/get-trtc-web-sdk-api.js +28 -0
  98. package/tools/rtcengine/get-trtc-web-sdk-api.js.map +1 -0
  99. package/tools/rtcengine/get-trtc-web-sdk-faq.js +2 -3
  100. package/tools/rtcengine/get-trtc-web-sdk-faq.js.map +1 -1
  101. package/tools/rtcengine/get-trtc-web-sdk-integration.js +29 -0
  102. package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +1 -0
  103. package/utils/report-cls-client.js +1 -1
  104. package/utils/report-es-client.js +1 -1
  105. package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
  106. package/libs/@tencent/aegis-node-sdk/LICENSE +0 -21
  107. package/libs/@tencent/aegis-node-sdk/README.md +0 -562
  108. package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
  109. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
  110. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
  111. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
  112. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
  113. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
  114. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
  115. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
  116. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
  117. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
  118. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
  119. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
  120. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
  121. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
  122. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
  123. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
  124. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
  125. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
  126. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
  127. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
  128. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
  129. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
  130. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
  131. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
  132. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
  133. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
  134. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
  135. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
  136. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
  137. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
  138. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
  139. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +0 -2
  140. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
  141. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
  142. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
  143. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
  144. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
  145. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
  146. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
  147. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
  148. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
  149. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
  150. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
  151. package/libs/@tencent/aegis-node-sdk/package.json +0 -19
  152. package/libs/@tencent/polaris/README.md +0 -407
  153. package/libs/@tencent/polaris/dist/consumer/health.d.ts +0 -126
  154. package/libs/@tencent/polaris/dist/consumer/health.js +0 -283
  155. package/libs/@tencent/polaris/dist/consumer/health.js.map +0 -1
  156. package/libs/@tencent/polaris/dist/consumer/index.d.ts +0 -120
  157. package/libs/@tencent/polaris/dist/consumer/index.js +0 -348
  158. package/libs/@tencent/polaris/dist/consumer/index.js.map +0 -1
  159. package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
  160. package/libs/@tencent/polaris/dist/consumer/monitor.js +0 -343
  161. package/libs/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
  162. package/libs/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
  163. package/libs/@tencent/polaris/dist/consumer/selector.js +0 -316
  164. package/libs/@tencent/polaris/dist/consumer/selector.js.map +0 -1
  165. package/libs/@tencent/polaris/dist/errors.d.ts +0 -373
  166. package/libs/@tencent/polaris/dist/errors.js +0 -154
  167. package/libs/@tencent/polaris/dist/errors.js.map +0 -1
  168. package/libs/@tencent/polaris/dist/global.d.ts +0 -16
  169. package/libs/@tencent/polaris/dist/global.js +0 -18
  170. package/libs/@tencent/polaris/dist/global.js.map +0 -1
  171. package/libs/@tencent/polaris/dist/index.d.ts +0 -62
  172. package/libs/@tencent/polaris/dist/index.js +0 -145
  173. package/libs/@tencent/polaris/dist/index.js.map +0 -1
  174. package/libs/@tencent/polaris/dist/instance.d.ts +0 -109
  175. package/libs/@tencent/polaris/dist/instance.js +0 -38
  176. package/libs/@tencent/polaris/dist/instance.js.map +0 -1
  177. package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
  178. package/libs/@tencent/polaris/dist/limiter/bucket.js +0 -152
  179. package/libs/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
  180. package/libs/@tencent/polaris/dist/limiter/index.d.ts +0 -73
  181. package/libs/@tencent/polaris/dist/limiter/index.js +0 -149
  182. package/libs/@tencent/polaris/dist/limiter/index.js.map +0 -1
  183. package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
  184. package/libs/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
  185. package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
  186. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
  187. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
  188. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
  189. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
  190. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
  191. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
  192. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
  193. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
  194. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
  195. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
  196. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
  197. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
  198. package/libs/@tencent/polaris/dist/location.d.ts +0 -48
  199. package/libs/@tencent/polaris/dist/location.js +0 -67
  200. package/libs/@tencent/polaris/dist/location.js.map +0 -1
  201. package/libs/@tencent/polaris/dist/logging.d.ts +0 -106
  202. package/libs/@tencent/polaris/dist/logging.js +0 -130
  203. package/libs/@tencent/polaris/dist/logging.js.map +0 -1
  204. package/libs/@tencent/polaris/dist/metadata.d.ts +0 -78
  205. package/libs/@tencent/polaris/dist/metadata.js +0 -119
  206. package/libs/@tencent/polaris/dist/metadata.js.map +0 -1
  207. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
  208. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
  209. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
  210. package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
  211. package/libs/@tencent/polaris/dist/plugins/lb/base.js +0 -32
  212. package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
  213. package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
  214. package/libs/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
  215. package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
  216. package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
  217. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
  218. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
  219. package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
  220. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
  221. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
  222. package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
  223. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
  224. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
  225. package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
  226. package/libs/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
  227. package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
  228. package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
  229. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
  230. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
  231. package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
  232. package/libs/@tencent/polaris/dist/plugins/logging/console.js +0 -38
  233. package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
  234. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
  235. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
  236. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
  237. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
  238. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
  239. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
  240. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
  241. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
  242. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
  243. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
  244. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
  245. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
  246. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
  247. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
  248. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
  249. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
  250. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
  251. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
  252. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
  253. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
  254. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
  255. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
  256. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
  257. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
  258. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
  259. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
  260. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
  261. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
  262. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
  263. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
  264. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
  265. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
  266. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
  267. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
  268. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
  269. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
  270. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
  271. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
  272. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
  273. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
  274. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
  275. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
  276. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
  277. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
  278. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
  279. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
  280. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
  281. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
  282. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
  283. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
  284. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
  285. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
  286. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
  287. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
  288. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
  289. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
  290. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
  291. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
  292. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
  293. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
  294. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
  295. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
  296. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
  297. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
  298. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
  299. package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
  300. package/libs/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
  301. package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
  302. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
  303. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
  304. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
  305. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
  306. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
  307. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
  308. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
  309. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
  310. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
  311. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
  312. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
  313. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
  314. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
  315. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
  316. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
  317. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
  318. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
  319. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
  320. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
  321. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
  322. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
  323. package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
  324. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
  325. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
  326. package/libs/@tencent/polaris/dist/plugins.d.ts +0 -619
  327. package/libs/@tencent/polaris/dist/plugins.js +0 -91
  328. package/libs/@tencent/polaris/dist/plugins.js.map +0 -1
  329. package/libs/@tencent/polaris/dist/polaris.d.ts +0 -33
  330. package/libs/@tencent/polaris/dist/polaris.js +0 -59
  331. package/libs/@tencent/polaris/dist/polaris.js.map +0 -1
  332. package/libs/@tencent/polaris/dist/provider/index.d.ts +0 -102
  333. package/libs/@tencent/polaris/dist/provider/index.js +0 -168
  334. package/libs/@tencent/polaris/dist/provider/index.js.map +0 -1
  335. package/libs/@tencent/polaris/dist/registry.d.ts +0 -174
  336. package/libs/@tencent/polaris/dist/registry.js +0 -660
  337. package/libs/@tencent/polaris/dist/registry.js.map +0 -1
  338. package/libs/@tencent/polaris/dist/rules.d.ts +0 -163
  339. package/libs/@tencent/polaris/dist/rules.js +0 -24
  340. package/libs/@tencent/polaris/dist/rules.js.map +0 -1
  341. package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
  342. package/libs/@tencent/polaris/dist/scripts/postinstall.js +0 -71
  343. package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
  344. package/libs/@tencent/polaris/dist/service.d.ts +0 -18
  345. package/libs/@tencent/polaris/dist/service.js +0 -3
  346. package/libs/@tencent/polaris/dist/service.js.map +0 -1
  347. package/libs/@tencent/polaris/dist/skeleton.d.ts +0 -87
  348. package/libs/@tencent/polaris/dist/skeleton.js +0 -282
  349. package/libs/@tencent/polaris/dist/skeleton.js.map +0 -1
  350. package/libs/@tencent/polaris/dist/utils.d.ts +0 -36
  351. package/libs/@tencent/polaris/dist/utils.js +0 -74
  352. package/libs/@tencent/polaris/dist/utils.js.map +0 -1
  353. package/libs/@tencent/polaris/dist/weak.d.ts +0 -11
  354. package/libs/@tencent/polaris/dist/weak.js +0 -44
  355. package/libs/@tencent/polaris/dist/weak.js.map +0 -1
  356. package/libs/@tencent/polaris/package.json +0 -114
  357. package/resource/doc/chatuikit/faq/web_qa.md +0 -118
  358. package/tools/call/get-call-faq.js +0 -29
  359. package/tools/call/get-call-faq.js.map +0 -1
  360. package/tools/chat/create-group.js.map +0 -1
  361. package/tools/chat/get-chat-faq.js +0 -29
  362. package/tools/chat/get-chat-faq.js.map +0 -1
  363. package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js +0 -34
  364. package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js.map +0 -1
  365. package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js +0 -35
  366. package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js.map +0 -1
  367. /package/resource/doc/chatuikit/{faq/sdk_qa.md → android/faq.md} +0 -0
  368. /package/{libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts → resource/doc/livekit/vue/faq.md} +0 -0
  369. /package/resource/doc/{chatuikit/faq/vue_qa.md → roomkit/vue/faq.md} +0 -0
  370. /package/resource/doc/rtcengine/web/{api_RTCEngine.md → api.md} +0 -0
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WRRLoadBalancer = void 0;
4
- const utils_1 = require("../../utils");
5
- const base_1 = require("./base");
6
- /**
7
- * Weighted Round-Robin Load Balancer
8
- *
9
- * @description
10
- * Algorithm:
11
- * 1. `S` = {S0, S1, S2, ..., Sn}, `W(Si)` = Si.weight
12
- * 2. CW(Si) = W(Si) / GCD(W(S))
13
- * 3. remaining_value = total_calls % Sum(CW(S))
14
- * 4. Sx = Pick(remaining_value ∈ [Sum(CW(S0)...CW(Si-1)), Sum(CW(S0)...CW(Si))))
15
- * 5. total_calls = total_calls + 1
16
- * 6. return Sx
17
- */
18
- class WRRLoadBalancer extends base_1.StatelessLoadBalancer {
19
- constructor() {
20
- super(...arguments);
21
- this.name = "WRRLoadBalancer";
22
- this.callStat = Object.create(null);
23
- }
24
- choose(namespace, service, instances) {
25
- // #region Round 1, 预处理
26
- /**
27
- * 当前服务被调用次数
28
- */
29
- let count = this.callStat[`${namespace}.${service}`];
30
- if (count >= 0) {
31
- count += 1;
32
- }
33
- else {
34
- count = 0;
35
- this.randomChoose(namespace, service, instances);
36
- }
37
- this.callStat[`${namespace}.${service}`] = count;
38
- /**
39
- * 各节点实际权重
40
- */
41
- let weights = instances.map(instance => ~~this.instanceWeight(instance));
42
- // #endregion
43
- // #region Round 2
44
- /*
45
- * Round 2:
46
- * 1. 计算所有权重的最大最大公约数 `gcd`
47
- * 2. 选取每个权重的互质数 `mpn` 作为新权重
48
- * 3. 计算新权重合
49
- */
50
- let totalWeight = 0;
51
- const gcd = (0, utils_1.GreatestCommonDivisor)(...weights.filter(weight => weight !== 0));
52
- if (!Number.isNaN(gcd)) {
53
- weights = weights.map((weight) => {
54
- const mpn = weight / gcd;
55
- totalWeight += mpn;
56
- return mpn;
57
- });
58
- }
59
- // #endregion
60
- // #region Round 3, 根据 WRR 算法选取目标节点
61
- if (!Number.isNaN(gcd)) {
62
- const remaining = count % totalWeight;
63
- for (let i = 0, effect = 0; i < weights.length; i += 1) {
64
- effect += weights[i];
65
- if (remaining < effect) {
66
- return instances[i];
67
- }
68
- }
69
- }
70
- else {
71
- /**
72
- * 当所有权重均为 0(gcd = NaN) 时,退化为 RR
73
- */
74
- return instances[count % instances.length];
75
- }
76
- (0, utils_1.UNREACHABLE)();
77
- // #endregion
78
- }
79
- }
80
- exports.WRRLoadBalancer = WRRLoadBalancer;
81
- //# sourceMappingURL=wrr.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrr.js","sourceRoot":"","sources":["../../../src/plugins/lb/wrr.ts"],"names":[],"mappings":";;;AACA,uCAAiE;AACjE,iCAA+C;AAE/C;;;;;;;;;;;GAWG;AACH,MAAa,eAAgB,SAAQ,4BAAqB;IAA1D;;QACW,SAAI,GAAW,iBAAiB,CAAC;QACzB,aAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAoC,CAAC;IA4DrF,CAAC;IA1DC,MAAM,CAAC,SAAiB,EAAE,OAAe,EAAE,SAAqB;QAC9D,uBAAuB;QACvB;;WAEG;QACH,IAAI,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAE,CAAC;QACtD,IAAI,KAAK,IAAI,CAAC,EAAE;YACd,KAAK,IAAI,CAAC,CAAC;SACZ;aAAM;YACL,KAAK,GAAG,CAAC,CAAC;YACV,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;SAClD;QACD,IAAI,CAAC,QAAQ,CAAC,GAA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9DD,0CA8DC"}
@@ -1,10 +0,0 @@
1
- /// <reference types="debug" />
2
- import { LogVerbosity } from "../../logging";
3
- import { PluginType, TraceLoggingPlugin } from "../../plugins";
4
- export declare class ConsoleTraceLogging implements TraceLoggingPlugin {
5
- readonly type = PluginType.TraceLogging;
6
- readonly name = "ConsoleTraceLogging";
7
- protected readonly tracers: Partial<Record<string, import("debug").Debugger>>;
8
- log(severity: LogVerbosity, prefix?: unknown, message?: unknown, ...optionalParams: unknown[]): void;
9
- trace(tracer: string, transaction: unknown, message?: unknown, ...optionalParams: unknown[]): void;
10
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConsoleTraceLogging = void 0;
4
- const debug_1 = require("debug");
5
- const util_1 = require("util");
6
- const logging_1 = require("../../logging");
7
- const plugins_1 = require("../../plugins");
8
- class ConsoleTraceLogging {
9
- constructor() {
10
- this.type = plugins_1.PluginType.TraceLogging;
11
- this.name = "ConsoleTraceLogging";
12
- this.tracers = Object.create(null); // 使用 `protected` 便于继承时重写
13
- }
14
- log(severity, prefix, message, ...optionalParams) {
15
- const logger = console[logging_1.LogVerbosity[severity].toLowerCase()];
16
- if (prefix !== undefined) {
17
- logger(prefix, message, ...optionalParams);
18
- }
19
- else {
20
- logger(message, ...optionalParams);
21
- }
22
- }
23
- trace(tracer, transaction, message, ...optionalParams) {
24
- let trace = this.tracers[tracer];
25
- if (!trace) {
26
- trace = (0, debug_1.default)(tracer);
27
- this.tracers[tracer] = trace;
28
- }
29
- if (transaction !== undefined) {
30
- trace((0, util_1.format)("<%s>", transaction), (0, util_1.format)(message, ...optionalParams));
31
- }
32
- else {
33
- trace(message, ...optionalParams);
34
- }
35
- }
36
- }
37
- exports.ConsoleTraceLogging = ConsoleTraceLogging;
38
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.js","sourceRoot":"","sources":["../../../src/plugins/logging/console.ts"],"names":[],"mappings":";;;AA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evision, NamingServicePlugin, OperatingMode, PluginType, ServiceRules } from "../../../plugins";
4
- export declare type DatabaseType = Partial<Record<string, {
5
- instances?: DataWithRevision<Instance[]>;
6
- rules?: DataWithRevision<ServiceRules>;
7
- }>>;
8
- export declare class LocalServerClient implements NamingServicePlugin {
9
- private database;
10
- location?: Location | undefined;
11
- readonly type = PluginType.NamingService;
12
- readonly name = "LocalServerClient";
13
- readonly mode = OperatingMode.Internal;
14
- constructor(database?: Partial<Record<string, {
15
- instances?: {
16
- data: Instance[];
17
- revision: string;
18
- } | undefined;
19
- rules?: {
20
- data: ServiceRules;
21
- revision: string;
22
- } | undefined;
23
- }>>, location?: Location | undefined);
24
- setInstances(namespace: string, service: string, instances: DataWithRevision<Instance[]>): void;
25
- setRules(namespace: string, service: string, rules: DataWithRevision<ServiceRules>): void;
26
- list(namespace: string, service: string, revision?: string): Promise<DataWithRevision<Instance[]>>;
27
- routingRules(namespace: string, service: string, revision?: string): Promise<DataWithRevision<ServiceRules>>;
28
- register(): Promise<string>;
29
- unregister(): Promise<boolean>;
30
- heartbeat(): Promise<boolean>;
31
- private getService;
32
- }
@@ -1,88 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalServerClient = void 0;
4
- const crypto_1 = require("crypto");
5
- const util_1 = require("util");
6
- const __1 = require("../../..");
7
- const plugins_1 = require("../../../plugins");
8
- class LocalServerClient {
9
- constructor(database = Object.create(null), location) {
10
- this.database = database;
11
- this.location = location;
12
- this.type = plugins_1.PluginType.NamingService;
13
- this.name = "LocalServerClient";
14
- this.mode = plugins_1.OperatingMode.Internal;
15
- /**
16
- * (empty function)
17
- */
18
- }
19
- setInstances(namespace, service, instances) {
20
- this.getService(namespace, service).instances = instances;
21
- }
22
- setRules(namespace, service, rules) {
23
- this.getService(namespace, service).rules = rules;
24
- }
25
- async list(namespace, service, revision) {
26
- const svr = this.database[`${namespace}.${service}`];
27
- if (!svr || !svr.instances) {
28
- throw new __1.ServiceNotFound(`[${namespace}.${service}] not found in local server`);
29
- }
30
- const { instances } = svr;
31
- if (revision && instances.revision === revision) {
32
- return {
33
- data: [],
34
- revision
35
- };
36
- }
37
- return instances;
38
- }
39
- async routingRules(namespace, service, revision) {
40
- const svr = this.database[`${namespace}.${service}`];
41
- if (!svr) {
42
- throw new __1.ServiceNotFound(`[${namespace}.${service}] not found in local server`);
43
- }
44
- const { rules } = svr;
45
- if (rules) {
46
- if (revision && rules.revision === revision) {
47
- return {
48
- data: {
49
- in: [],
50
- out: []
51
- },
52
- revision
53
- };
54
- }
55
- return rules;
56
- }
57
- /**
58
- * 如果服务已配置,
59
- * 但规则没有配置则使用空规则
60
- */
61
- return {
62
- data: {
63
- in: [],
64
- out: []
65
- },
66
- revision: ""
67
- };
68
- }
69
- async register() {
70
- return (await (0, util_1.promisify)(crypto_1.randomBytes)(16)).toString("hex");
71
- }
72
- async unregister() {
73
- return true;
74
- }
75
- async heartbeat() {
76
- return true;
77
- }
78
- getService(namespace, service) {
79
- let svr = this.database[`${namespace}.${service}`];
80
- if (!svr) {
81
- svr = Object.create(null);
82
- this.database[`${namespace}.${service}`] = svr;
83
- }
84
- return svr;
85
- }
86
- }
87
- exports.LocalServerClient = LocalServerClient;
88
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugins/naming/local-server/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AACrC,+BAAiC;AAEjC,gCAA2C;AAG3C,8CAAkH;AAOlH,MAAa,iBAAiB;IAK5B,YACU,WAAW,MAAM,CAAC,MAAM,CAAC,IAAI,CAAiB,EAC/C,QAAmB;QADlB,aAAQ,GAAR,QAAQ,CAAsC;QAC/C,aAAQ,GAAR,QAAQ,CAAW;QANnB,SAAI,GAAG,oBAAU,CAAC,aAAa,CAAC;QAChC,SAAI,GAAG,mBAAmB,CAAC;QAC3B,SAAI,GAAG,uBAAa,CAAC,QAAQ,CAAC;QAMrC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AO;oBACL,IAAI,EAAE;wBACJ,EAAE,EAAE,EAAE;wBACN,GAAG,EAAE,EAAE;qBACR;oBACD,QAAQ;iBACT,CAAC;aACH;YACD,OAAO,KAAK,CAAC;SACd;QAED;;;WAGG;QACH,OAAO;YACL,IAAI,EAAE;gBACJ,EAAE,EAAE,EAAE;gBACN,GAAG,EAAE,EAAE;aACR;YACD,QAAQ,EAAE,EAAE;SACb,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,CAAC,MAAM,IAAA,gBAAS,EAAC,oBAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,UAAU,CAAC,SAAiB,EAAE,OAAe;QACnD,IAAI,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAkC,CAAC;YAC3D,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC,GAAG,GAAG,CAAC;SAChD;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAhGD,8CAgGC"}
@@ -1,124 +0,0 @@
1
- import { Logger, InternalConsumer, SelectResponse } from "../../../..";
2
- import { Location } from "../../../../location";
3
- import { NamingServicePlugin, OperatingMode, PluginType } from "../../../../plugins";
4
- import { RemoveNever } from "../../../../utils";
5
- import type { Boxable, BoxType, DeconstructorWrappers, MonitorService, PolarisService, RatelimitService } from "..";
6
- import { ClientPool, ClientPoolOptions, ClosableClient } from "../pool";
7
- import { ServiceType } from "../types";
8
- import { EndPoint, ProtobufFormat } from "../utils";
9
- export interface BaseAdapterOptions {
10
- /**
11
- * 北极星后端节点连通性探测,最长超时时间
12
- * 单位 ms
13
- */
14
- detectionTimeout: number;
15
- /**
16
- * 北极星后端节点切换时长
17
- * 单位 ms
18
- */
19
- switchDuration: number;
20
- /**
21
- * 北极星后端命名空间
22
- * __请勿随意修改此配置__
23
- */
24
- polarisNamespace: string;
25
- /**
26
- * 服务发现后端服务名
27
- * __请勿随意修改此配置__
28
- */
29
- discoverService: string;
30
- /**
31
- * 预置实例上报后缀名
32
- * __请勿随意修改此配置__
33
- */
34
- presetSuffix: string;
35
- /**
36
- * 预置实例是否仅用于引导启动
37
- * __请勿随意修改此配置__
38
- */
39
- bootstrapOnly: boolean;
40
- }
41
- declare type ExtractServiceAPI<Service> = RemoveNever<{
42
- [P in keyof Service]: Service[P] extends (request: infer U) => Promise<infer K> ? K extends unknown ? U extends unknown ? (request: DeconstructorWrappers<U>) => Promise<DeconstructorWrappers<K>> : never : never : never;
43
- }>;
44
- export declare type DiscoverApi = ExtractServiceAPI<PolarisService.ServerAPI>;
45
- export declare type MonitorApi = ExtractServiceAPI<MonitorService.MonitorApi>;
46
- export declare type RatelimitApi = ExtractServiceAPI<RatelimitService.RateLimitAPI>;
47
- export declare type PolarisApi = DiscoverApi & MonitorApi & RatelimitApi;
48
- export declare type PolarisClient = PolarisApi & ClosableClient;
49
- export declare type PolarisResponse = Awaited<ReturnType<PolarisApi[keyof PolarisApi]>>;
50
- export declare type PolarisRequest = Awaited<ReturnType<PolarisApi[keyof PolarisApi]>>;
51
- /**
52
- * 显式声明 `PolarisBaseAdapter` 扩展于 `NamingServicePlugin`,
53
- * 以便于共享当前插件实例
54
- */
55
- export interface PolarisBaseAdapter extends NamingServicePlugin, Boxable {
56
- }
57
- /**
58
- * 由于 class ... implements ... 中 class 必须要实现 implements 中的接口,
59
- * 并且 `Mixin` 方法无法组合(继承)类型,故在此仅实现 `Boxable` 接口
60
- */
61
- export declare abstract class PolarisBaseAdapter implements Boxable {
62
- private readonly remotes;
63
- readonly mode = OperatingMode.Internal;
64
- protected logger: Logger;
65
- protected readonly options: BaseAdapterOptions & ClientPoolOptions;
66
- protected readonly pool: ClientPool<PolarisClient>;
67
- protected stickyConsumer?: InternalConsumer;
68
- protected local?: EndPoint;
69
- protected disposeFuncs: Record<string, () => void>;
70
- protected disposed: boolean;
71
- protected initializeStatus: {
72
- promise: Promise<unknown> | null;
73
- initialized: boolean; /** fast case */
74
- };
75
- private mainConsumer?;
76
- private localRegistry?;
77
- private loc;
78
- readonly abstract type: PluginType;
79
- readonly abstract name: string;
80
- protected abstract readonly protocol: string;
81
- protected abstract readonly format: ProtobufFormat;
82
- constructor(remotes: readonly string[]);
83
- setLogger(logger: Logger): void;
84
- get location(): Location;
85
- dispose(): Promise<void>;
86
- get isDisposed(): boolean;
87
- /**
88
- * 由于 `stickyConsumer` 仅用于少数调用,
89
- * 故在一般情况下(如:仅使用 Consumer 时)不会被调用,
90
- * 在这里做延迟初始化以节省内存开销
91
- */
92
- protected buildStickyConsumer(): InternalConsumer;
93
- protected selectBackend(consumer: InternalConsumer, service: string, key?: string): Promise<SelectResponse>;
94
- /**
95
- * 此函数签名用于调用
96
- */
97
- protected requestBackend<MethodName extends keyof PolarisApi>(type: ServiceType, service: string, method: MethodName, payload: Parameters<PolarisApi[MethodName]>[0], key?: string): Promise<Awaited<ReturnType<PolarisApi[MethodName]>>>;
98
- /**
99
- * 追踪后端调用结果
100
- * @param transaction 追踪 ID
101
- * @param method 调用函数名
102
- * @param response 后端响应
103
- */
104
- protected tracingResponse(transaction: string, method: string, response: PolarisResponse): void;
105
- /**
106
- * 判断后端调用是否成功(不成功则抛出异常)
107
- * @param response 后端响应
108
- * @param namespace 命名空间
109
- * @param service 服务名
110
- */
111
- protected maybeErrorResponse(response: PolarisResponse, namespace: string, service: string): void;
112
- /**
113
- * 判断后端调用是否成功
114
- * @param response 后端响应
115
- * @param level 比较级别(默认为 `kErrorLevel`)
116
- */
117
- protected isSuccessResponse(response: PolarisResponse, level?: number): boolean;
118
- protected waitForInitialized(): Promise<void>;
119
- private bootstrap;
120
- abstract unbox<T>(value: BoxType<T> | T | null | undefined, defaultValue: T | (() => T)): T;
121
- abstract box<T>(value: T): BoxType<T> | T | null | undefined;
122
- protected abstract buildClient<T extends PolarisClient>(address: string, type: ServiceType): T;
123
- }
124
- export {};