@tencentcloud/sdk-mcp 1.2.6 → 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 (351) 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/web_sdk/.gitkeep +0 -0
  13. package/resource/doc/tuicallkit/android/faq.md +1000 -0
  14. package/resource/doc/tuicallkit/faq/common/error_code.md +47 -0
  15. package/resource/doc/tuicallkit/flutter/faq.md +981 -0
  16. package/resource/doc/tuicallkit/{faq → iOS}/faq.md +0 -72
  17. package/resource/doc/tuicallkit/react/faq.md +986 -0
  18. package/resource/doc/tuicallkit/vue/faq.md +986 -0
  19. package/tools/call/get-native-call-integration.js +4 -10
  20. package/tools/call/get-native-call-integration.js.map +1 -1
  21. package/tools/call/get-web-call-api.js +4 -7
  22. package/tools/call/get-web-call-api.js.map +1 -1
  23. package/tools/call/get-web-call-integration.js +4 -9
  24. package/tools/call/get-web-call-integration.js.map +1 -1
  25. package/tools/chat/get-native-chat-integration.js +4 -8
  26. package/tools/chat/get-native-chat-integration.js.map +1 -1
  27. package/tools/chat/get-web-chat-component-detail.js +5 -10
  28. package/tools/chat/get-web-chat-component-detail.js.map +1 -1
  29. package/tools/chat/get-web-chat-integration.js +4 -12
  30. package/tools/chat/get-web-chat-integration.js.map +1 -1
  31. package/tools/chat/get-web-chat-uikit-init.js +5 -6
  32. package/tools/chat/get-web-chat-uikit-init.js.map +1 -1
  33. package/tools/chat/get-web-chat-window-integration.js +4 -12
  34. package/tools/chat/get-web-chat-window-integration.js.map +1 -1
  35. package/tools/chat/{create-group.js → get-web-create-group-doc.js} +5 -6
  36. package/tools/chat/get-web-create-group-doc.js.map +1 -0
  37. package/tools/common/get-faq.js +93 -0
  38. package/tools/common/get-faq.js.map +1 -0
  39. package/tools/common/get-usersig.js +9 -18
  40. package/tools/common/get-usersig.js.map +1 -1
  41. package/tools/common/present-framework-choice.js +3 -10
  42. package/tools/common/present-framework-choice.js.map +1 -1
  43. package/tools/common/record-prompt.js +5 -12
  44. package/tools/common/record-prompt.js.map +1 -1
  45. package/tools/common/record-result.js +7 -11
  46. package/tools/common/record-result.js.map +1 -1
  47. package/tools/definitions/get_faq_def.js +28 -0
  48. package/tools/definitions/get_faq_def.js.map +1 -0
  49. package/tools/definitions/get_native_call_uikit_integration_def.js +21 -0
  50. package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -0
  51. package/tools/definitions/get_native_chat_uikit_integration_def.js +21 -0
  52. package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -0
  53. package/tools/definitions/get_usersig_def.js +34 -0
  54. package/tools/definitions/get_usersig_def.js.map +1 -0
  55. package/tools/definitions/get_web_call_uikit_api_def.js +23 -0
  56. package/tools/definitions/get_web_call_uikit_api_def.js.map +1 -0
  57. package/tools/definitions/get_web_call_uikit_integration_def.js +20 -0
  58. package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -0
  59. package/tools/definitions/get_web_chat_uikit_component_detail_def.js +24 -0
  60. package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -0
  61. package/tools/definitions/get_web_chat_uikit_init_def.js +23 -0
  62. package/tools/definitions/get_web_chat_uikit_init_def.js.map +1 -0
  63. package/tools/definitions/get_web_chat_uikit_integration_def.js +26 -0
  64. package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -0
  65. package/tools/definitions/get_web_chat_window_integration_def.js +26 -0
  66. package/tools/definitions/get_web_chat_window_integration_def.js.map +1 -0
  67. package/tools/definitions/get_web_create_group_doc_def.js +18 -0
  68. package/tools/definitions/get_web_create_group_doc_def.js.map +1 -0
  69. package/tools/definitions/get_web_live_state_detail_def.js +19 -0
  70. package/tools/definitions/get_web_live_state_detail_def.js.map +1 -0
  71. package/tools/definitions/get_web_live_uikit_component_detail_def.js +21 -0
  72. package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +1 -0
  73. package/tools/definitions/get_web_room_state_detail_def.js +19 -0
  74. package/tools/definitions/get_web_room_state_detail_def.js.map +1 -0
  75. package/tools/definitions/present_framework_choice_def.js +24 -0
  76. package/tools/definitions/present_framework_choice_def.js.map +1 -0
  77. package/tools/definitions/record_prompt_def.js +22 -0
  78. package/tools/definitions/record_prompt_def.js.map +1 -0
  79. package/tools/definitions/record_result_def.js +22 -0
  80. package/tools/definitions/record_result_def.js.map +1 -0
  81. package/tools/index.js +7 -9
  82. package/tools/index.js.map +1 -1
  83. package/tools/live/get-web-live-component-detail.js +5 -7
  84. package/tools/live/get-web-live-component-detail.js.map +1 -1
  85. package/tools/live/get-web-live-state-detail.js +5 -7
  86. package/tools/live/get-web-live-state-detail.js.map +1 -1
  87. package/tools/room/get-web-room-state-detail.js +5 -7
  88. package/tools/room/get-web-room-state-detail.js.map +1 -1
  89. package/utils/report-cls-client.js +1 -1
  90. package/utils/report-es-client.js +1 -1
  91. package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
  92. package/libs/@tencent/aegis-node-sdk/LICENSE +0 -21
  93. package/libs/@tencent/aegis-node-sdk/README.md +0 -562
  94. package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
  95. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
  96. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
  97. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
  98. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
  99. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
  100. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
  101. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
  102. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
  103. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
  104. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
  105. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
  106. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
  107. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
  108. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
  109. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
  110. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
  111. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
  112. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
  113. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
  114. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
  115. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
  116. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
  117. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
  118. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
  119. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
  120. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
  121. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
  122. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
  123. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
  124. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
  125. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +0 -2
  126. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
  127. package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
  128. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
  129. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
  130. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
  131. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
  132. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
  133. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
  134. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
  135. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
  136. package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
  137. package/libs/@tencent/aegis-node-sdk/package.json +0 -19
  138. package/libs/@tencent/polaris/README.md +0 -407
  139. package/libs/@tencent/polaris/dist/consumer/health.d.ts +0 -126
  140. package/libs/@tencent/polaris/dist/consumer/health.js +0 -283
  141. package/libs/@tencent/polaris/dist/consumer/health.js.map +0 -1
  142. package/libs/@tencent/polaris/dist/consumer/index.d.ts +0 -120
  143. package/libs/@tencent/polaris/dist/consumer/index.js +0 -348
  144. package/libs/@tencent/polaris/dist/consumer/index.js.map +0 -1
  145. package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
  146. package/libs/@tencent/polaris/dist/consumer/monitor.js +0 -343
  147. package/libs/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
  148. package/libs/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
  149. package/libs/@tencent/polaris/dist/consumer/selector.js +0 -316
  150. package/libs/@tencent/polaris/dist/consumer/selector.js.map +0 -1
  151. package/libs/@tencent/polaris/dist/errors.d.ts +0 -373
  152. package/libs/@tencent/polaris/dist/errors.js +0 -154
  153. package/libs/@tencent/polaris/dist/errors.js.map +0 -1
  154. package/libs/@tencent/polaris/dist/global.d.ts +0 -16
  155. package/libs/@tencent/polaris/dist/global.js +0 -18
  156. package/libs/@tencent/polaris/dist/global.js.map +0 -1
  157. package/libs/@tencent/polaris/dist/index.d.ts +0 -62
  158. package/libs/@tencent/polaris/dist/index.js +0 -145
  159. package/libs/@tencent/polaris/dist/index.js.map +0 -1
  160. package/libs/@tencent/polaris/dist/instance.d.ts +0 -109
  161. package/libs/@tencent/polaris/dist/instance.js +0 -38
  162. package/libs/@tencent/polaris/dist/instance.js.map +0 -1
  163. package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
  164. package/libs/@tencent/polaris/dist/limiter/bucket.js +0 -152
  165. package/libs/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
  166. package/libs/@tencent/polaris/dist/limiter/index.d.ts +0 -73
  167. package/libs/@tencent/polaris/dist/limiter/index.js +0 -149
  168. package/libs/@tencent/polaris/dist/limiter/index.js.map +0 -1
  169. package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
  170. package/libs/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
  171. package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
  172. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
  173. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
  174. package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
  175. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
  176. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
  177. package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
  178. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
  179. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
  180. package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
  181. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
  182. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
  183. package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
  184. package/libs/@tencent/polaris/dist/location.d.ts +0 -48
  185. package/libs/@tencent/polaris/dist/location.js +0 -67
  186. package/libs/@tencent/polaris/dist/location.js.map +0 -1
  187. package/libs/@tencent/polaris/dist/logging.d.ts +0 -106
  188. package/libs/@tencent/polaris/dist/logging.js +0 -130
  189. package/libs/@tencent/polaris/dist/logging.js.map +0 -1
  190. package/libs/@tencent/polaris/dist/metadata.d.ts +0 -78
  191. package/libs/@tencent/polaris/dist/metadata.js +0 -119
  192. package/libs/@tencent/polaris/dist/metadata.js.map +0 -1
  193. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
  194. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
  195. package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
  196. package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
  197. package/libs/@tencent/polaris/dist/plugins/lb/base.js +0 -32
  198. package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
  199. package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
  200. package/libs/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
  201. package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
  202. package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
  203. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
  204. package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
  205. package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
  206. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
  207. package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
  208. package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
  209. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
  210. package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
  211. package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
  212. package/libs/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
  213. package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
  214. package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
  215. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
  216. package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
  217. package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
  218. package/libs/@tencent/polaris/dist/plugins/logging/console.js +0 -38
  219. package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
  220. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
  221. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
  222. package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
  223. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
  224. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
  225. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
  226. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
  227. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
  228. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
  229. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
  230. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
  231. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
  232. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
  233. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
  234. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
  235. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
  236. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
  237. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
  238. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
  239. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
  240. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
  241. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
  242. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
  243. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
  244. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
  245. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
  246. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
  247. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
  248. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
  249. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
  250. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
  251. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
  252. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
  253. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
  254. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
  255. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
  256. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
  257. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
  258. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
  259. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
  260. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
  261. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
  262. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
  263. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
  264. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
  265. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
  266. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
  267. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
  268. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
  269. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
  270. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
  271. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
  272. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
  273. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
  274. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
  275. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
  276. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
  277. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
  278. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
  279. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
  280. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
  281. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
  282. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
  283. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
  284. package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
  285. package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
  286. package/libs/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
  287. package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
  288. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
  289. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
  290. package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
  291. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
  292. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
  293. package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
  294. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
  295. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
  296. package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
  297. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
  298. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
  299. package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
  300. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
  301. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
  302. package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
  303. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
  304. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
  305. package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
  306. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
  307. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
  308. package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
  309. package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
  310. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
  311. package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
  312. package/libs/@tencent/polaris/dist/plugins.d.ts +0 -619
  313. package/libs/@tencent/polaris/dist/plugins.js +0 -91
  314. package/libs/@tencent/polaris/dist/plugins.js.map +0 -1
  315. package/libs/@tencent/polaris/dist/polaris.d.ts +0 -33
  316. package/libs/@tencent/polaris/dist/polaris.js +0 -59
  317. package/libs/@tencent/polaris/dist/polaris.js.map +0 -1
  318. package/libs/@tencent/polaris/dist/provider/index.d.ts +0 -102
  319. package/libs/@tencent/polaris/dist/provider/index.js +0 -168
  320. package/libs/@tencent/polaris/dist/provider/index.js.map +0 -1
  321. package/libs/@tencent/polaris/dist/registry.d.ts +0 -174
  322. package/libs/@tencent/polaris/dist/registry.js +0 -660
  323. package/libs/@tencent/polaris/dist/registry.js.map +0 -1
  324. package/libs/@tencent/polaris/dist/rules.d.ts +0 -163
  325. package/libs/@tencent/polaris/dist/rules.js +0 -24
  326. package/libs/@tencent/polaris/dist/rules.js.map +0 -1
  327. package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
  328. package/libs/@tencent/polaris/dist/scripts/postinstall.js +0 -71
  329. package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
  330. package/libs/@tencent/polaris/dist/service.d.ts +0 -18
  331. package/libs/@tencent/polaris/dist/service.js +0 -3
  332. package/libs/@tencent/polaris/dist/service.js.map +0 -1
  333. package/libs/@tencent/polaris/dist/skeleton.d.ts +0 -87
  334. package/libs/@tencent/polaris/dist/skeleton.js +0 -282
  335. package/libs/@tencent/polaris/dist/skeleton.js.map +0 -1
  336. package/libs/@tencent/polaris/dist/utils.d.ts +0 -36
  337. package/libs/@tencent/polaris/dist/utils.js +0 -74
  338. package/libs/@tencent/polaris/dist/utils.js.map +0 -1
  339. package/libs/@tencent/polaris/dist/weak.d.ts +0 -11
  340. package/libs/@tencent/polaris/dist/weak.js +0 -44
  341. package/libs/@tencent/polaris/dist/weak.js.map +0 -1
  342. package/libs/@tencent/polaris/package.json +0 -114
  343. package/resource/doc/chatuikit/faq/web_qa.md +0 -118
  344. package/tools/call/get-call-faq.js +0 -29
  345. package/tools/call/get-call-faq.js.map +0 -1
  346. package/tools/chat/create-group.js.map +0 -1
  347. package/tools/chat/get-chat-faq.js +0 -29
  348. package/tools/chat/get-chat-faq.js.map +0 -1
  349. /package/resource/doc/chatuikit/{faq/sdk_qa.md → android/faq.md} +0 -0
  350. /package/{libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts → resource/doc/livekit/vue/faq.md} +0 -0
  351. /package/resource/doc/{chatuikit/faq/vue_qa.md → roomkit/vue/faq.md} +0 -0
@@ -1,259 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PolarisGRPCClient = void 0;
4
- const package_json_1 = require("@grpc/grpc-js/package.json");
5
- const protoLoader = require("@grpc/proto-loader");
6
- const path = require("path");
7
- const semver = require("semver");
8
- const __1 = require("../../../../..");
9
- const utils_1 = require("../../../../../utils");
10
- const adapter_1 = require("../../adapter");
11
- const types_1 = require("../../types");
12
- const utils_2 = require("../../utils");
13
- const bidi_1 = require("./bidi");
14
- /**
15
- * `@grpc/grpc-js` 模块在导入时会校验当前环境是否满足其运行要求,
16
- * 如不满足直接抛出异常,由于 `import` 语法所限无法进行捕获,
17
- * 故在此采用 `require` 延迟加载。
18
- */
19
- let grpcjs;
20
- const kProtoFile = {
21
- [types_1.ServiceType.Discover]: path.join(__dirname, "pb", "discover.proto"),
22
- [types_1.ServiceType.Monitor]: path.join(__dirname, "pb", "monitor.proto"),
23
- [types_1.ServiceType.Ratelimit]: path.join(__dirname, "pb", "ratelimit.proto")
24
- };
25
- const kDefaultOptions = {
26
- /**
27
- * 调用超时时间
28
- */
29
- timeout: 10 * utils_1.kSeconds,
30
- /**
31
- * gRPC 配置项
32
- */
33
- grpc: {
34
- /**
35
- * gRPC CallOptions 配置项
36
- */
37
- call: {},
38
- /**
39
- * gRPC ChannelOptions 配置项
40
- */
41
- channel: {}
42
- }
43
- };
44
- const isIDiscoverRequest = (arg) => "type" in arg && "service" in arg;
45
- const isIDiscoverResponse = (arg) => "type" in arg;
46
- const isIdentifiablePacket = (arg) => Object.prototype.hasOwnProperty.call(arg, "id") || Object.prototype.hasOwnProperty.call(arg, "key");
47
- const loadPackageDefinition = (type) => {
48
- // eslint-disable-next-line @typescript-eslint/unbound-method
49
- const { emitWarning } = process;
50
- /*
51
- * note:
52
- * 由于 `@grpc/proto-loader` 在处理 options.includeDirs 时,
53
- * 对于 `import google/protobuf/*.proto` 会抛出不正确的异常,
54
- * 故在此屏蔽进行屏蔽,并在调用完 `loadSync` 后进行重置。
55
- */
56
- process.emitWarning = () => { };
57
- const packageDefinition = protoLoader.loadSync(kProtoFile[type], {
58
- defaults: true,
59
- keepCase: true,
60
- longs: Number,
61
- includeDirs: [utils_2.kProtoPath[type]]
62
- });
63
- process.emitWarning = emitWarning;
64
- return grpcjs.loadPackageDefinition(packageDefinition).v1;
65
- };
66
- class PolarisGRPCClient extends adapter_1.PolarisServerAdapter {
67
- constructor(remotes, options) {
68
- super(remotes, options);
69
- this.name = "PolarisGRPCClient";
70
- this.protocol = PolarisGRPCClient.protocol;
71
- this.format = utils_2.ProtobufFormat.Original;
72
- this.options = Object.assign(Object.assign(Object.assign(Object.assign({}, this.options), kDefaultOptions), options), { grpc: Object.assign(Object.assign(Object.assign({}, this.options.grpc), kDefaultOptions.grpc), options === null || options === void 0 ? void 0 : options.grpc) });
73
- if (!PolarisGRPCClient.isSupported()) {
74
- throw new __1.PluginError(`grpc client only works on Node ${package_json_1.engines.node}`);
75
- }
76
- if (!grpcjs) {
77
- grpcjs = require("@grpc/grpc-js"); // eslint-disable-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
78
- }
79
- this.clientConstructor = {
80
- [types_1.ServiceType.Discover]: loadPackageDefinition(types_1.ServiceType.Discover).PolarisGRPC,
81
- [types_1.ServiceType.Monitor]: loadPackageDefinition(types_1.ServiceType.Monitor).GrpcAPI,
82
- [types_1.ServiceType.Ratelimit]: loadPackageDefinition(types_1.ServiceType.Ratelimit).RateLimitGRPC
83
- };
84
- }
85
- static isSupported() {
86
- return semver.satisfies(process.versions.node, package_json_1.engines.node);
87
- }
88
- box(value) {
89
- if (value === null || typeof value === "undefined") {
90
- return value;
91
- }
92
- return {
93
- value
94
- };
95
- }
96
- unbox(value, defaultValue) {
97
- const val = value;
98
- if (val && typeof val.value !== "undefined" && val.value !== null) {
99
- return val.value;
100
- }
101
- if (typeof defaultValue === "function") {
102
- return defaultValue();
103
- }
104
- return defaultValue;
105
- }
106
- // #region #AOP#
107
- /**
108
- * 实例化 Service Client,可重载此方法实现差异化配置
109
- * @param address 远端地址
110
- * @param type 远端类型
111
- * @param ServiceClient Service Client Class,函数必须返回它的实例
112
- * @param credentials grpc.credentials
113
- */
114
- instantiateServiceClient(address, type, ServiceClient, credentials) {
115
- return new ServiceClient(address, credentials.createInsecure(), this.options.grpc.channel);
116
- }
117
- /**
118
- * 获取 grpc.CallOptions 配置,可重载此方法实现差异化配置
119
- * @param address 远端地址
120
- * @param method 方法名
121
- * @param streaming 是否为 Bidi Stream
122
- */
123
- getCallOptions(address, method, streaming) {
124
- const { options: { timeout, grpc: { call: callOptions } } } = this;
125
- if (streaming) {
126
- return callOptions;
127
- }
128
- return Object.assign(Object.assign({}, callOptions), { deadline: Date.now() + timeout });
129
- }
130
- // #endregion
131
- buildClient(address, type) {
132
- const { logger, options: { timeout } } = this;
133
- const { transaction } = logger;
134
- logger.trace("Plugins" /* Plugins */, this.name, "buildClient", transaction, "remote address is", address, "and type is", type);
135
- const ServiceClient = this.clientConstructor[type]; // eslint-disable-line @typescript-eslint/naming-convention
136
- const grpcClient = this.instantiateServiceClient(address, type, ServiceClient, grpcjs.credentials);
137
- const client = Object.create(null);
138
- const bidi = [];
139
- for (const name of Object.keys(ServiceClient.service)) {
140
- const { requestStream, responseStream, originalName } = ServiceClient.service[name];
141
- const method = (originalName || name);
142
- if (!requestStream && !responseStream) {
143
- /* Unary */
144
- client[method] = ((request) => new Promise((resolve, reject) => {
145
- grpcClient[name](request, this.getCallOptions(address, name, false), (err, value) => {
146
- if (err) {
147
- reject(err);
148
- }
149
- else {
150
- resolve(value);
151
- }
152
- });
153
- }));
154
- }
155
- else if (requestStream && responseStream) {
156
- /* Bidi */
157
- const caller = new bidi_1.StreamCaller(grpcClient[name]
158
- .bind(grpcClient, this.getCallOptions(address, name, true)), this.keyGenerator.bind(this), timeout);
159
- client[method] = ((request) => caller.request(request));
160
- bidi.push(caller);
161
- }
162
- else {
163
- (0, utils_1.UNREACHABLE)();
164
- }
165
- }
166
- client.close = () => {
167
- logger.trace("Plugins" /* Plugins */, this.name, "buildClient", transaction, "close all client");
168
- bidi.forEach(caller => caller.close());
169
- /*
170
- * avoid GRPC Error:
171
- * 14 UNAVAILABLE: No connection established
172
- */
173
- try {
174
- grpcClient.close();
175
- }
176
- catch (e) {
177
- logger.trace("Plugins" /* Plugins */, this.name, "buildClient", transaction, "close grpc client exception with", e);
178
- logger.error(`[${this.name}] [close]`, e);
179
- }
180
- };
181
- return client;
182
- }
183
- requestKeyGenerator(request) {
184
- var _a;
185
- if (isIDiscoverRequest(request) && request.service) {
186
- const { namespace, name } = request.service;
187
- return {
188
- keys: [namespace, name],
189
- type: request.type
190
- };
191
- }
192
- if (isIdentifiablePacket(request)) {
193
- return {
194
- keys: [(_a = request.id) !== null && _a !== void 0 ? _a : request.key],
195
- type: "*"
196
- };
197
- }
198
- (0, utils_1.UNREACHABLE)();
199
- }
200
- responseKeyGenerator(response) {
201
- var _a;
202
- if (isIDiscoverResponse(response)) {
203
- /** intentional convert */
204
- switch (response.type) {
205
- case types_1.DiscoverRequestType.INSTANCE: // [[fallthrough]]
206
- case types_1.DiscoverRequestType.ROUTING: // [[fallthrough]]
207
- case types_1.DiscoverRequestType.RATE_LIMIT: {
208
- if (response.service) {
209
- const { namespace, name } = response.service;
210
- return {
211
- keys: [namespace, name],
212
- type: response.type
213
- };
214
- }
215
- (0, utils_1.UNREACHABLE)();
216
- }
217
- case types_1.DiscoverRequestType.CLUSTER: // [[fallthrough]]
218
- case types_1.DiscoverRequestType.UNKNOWN: // [[fallthrough]]
219
- default: {
220
- (0, utils_1.UNREACHABLE)();
221
- }
222
- }
223
- (0, utils_1.UNREACHABLE)(); /** Stub */
224
- }
225
- if (isIdentifiablePacket(response)) {
226
- return {
227
- keys: [(_a = response.id) !== null && _a !== void 0 ? _a : response.key],
228
- type: "*"
229
- };
230
- }
231
- (0, utils_1.UNREACHABLE)();
232
- }
233
- keyGenerator(direction, packet) {
234
- let type;
235
- let keys;
236
- switch (direction) {
237
- case bidi_1.PacketDirection.Request: {
238
- ({ keys, type } = this.requestKeyGenerator(packet));
239
- break;
240
- }
241
- case bidi_1.PacketDirection.Response: {
242
- ({ keys, type } = this.responseKeyGenerator(packet));
243
- break;
244
- }
245
- default: {
246
- (0, utils_1.UNREACHABLE)();
247
- }
248
- }
249
- keys = keys.map(key => this.unbox(key, typeof key === "string" ? key : ""));
250
- if (keys.every(key => key === "") || type === undefined) {
251
- (0, utils_1.UNREACHABLE)();
252
- }
253
- return `${type}.${keys.join(".")}`;
254
- }
255
- }
256
- exports.PolarisGRPCClient = PolarisGRPCClient;
257
- PolarisGRPCClient.protocol = "grpc";
258
- PolarisGRPCClient.port = 8081;
259
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/plugins/naming/polaris-server/connector/grpc/index.ts"],"names":[],"mappings":";;;AACA,6DAAyE;AACzE,kDAAkD;AAClD,6BAA6B;AAC7B,iCAAiC;AAEjC,sCAA4D;AAC5D,gDAA4E;AAE5E,2CAA4G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AAI,KAAK,SAAS,EAAE;YACvD,IAAA,mBAAW,GAAE,CAAC;SACf;QAED,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,CAAC;;AAvPH,8CAwPC;AAvPiB,0BAAQ,GAAG,MAAM,CAAC;AAClB,sBAAI,GAAG,IAAI,CAAC"}
@@ -1,24 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "client.proto";
6
- import "service.proto";
7
- import "request.proto";
8
- import "response.proto";
9
-
10
- service PolarisGRPC {
11
- // 客户端上报
12
- rpc ReportClient(Client) returns(Response) {}
13
-
14
- // 被调方注册服务实例
15
- rpc RegisterInstance(Instance) returns(Response) {}
16
- // 被调方反注册服务实例
17
- rpc DeregisterInstance(Instance) returns(Response) {}
18
-
19
- // 统一发现接口
20
- rpc Discover(stream DiscoverRequest) returns(stream DiscoverResponse) {}
21
-
22
- // 被调方上报心跳
23
- rpc Heartbeat(Instance) returns(Response) {}
24
- }
@@ -1,18 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "request.proto";
6
- import "response.proto";
7
- import "sdkconfiguration.proto";
8
- import "sdkcache.proto";
9
- import "circuitbreak.proto";
10
-
11
- service GrpcAPI {
12
- rpc CollectServerStatistics(stream ServerStatistics) returns(stream StatResponse) {}
13
- rpc CollectSDKAPIStatistics(stream SDKAPIStatistics) returns(stream StatResponse) {}
14
- rpc CollectServiceStatistics(stream ServiceStatistics) returns(stream StatResponse) {}
15
- rpc CollectSDKConfiguration(SDKConfig) returns(StatResponse) {}
16
- rpc CollectSDKCache(stream ServiceInfo) returns(stream StatResponse) {}
17
- rpc CollectCircuitBreak(stream ServiceCircuitbreak) returns(stream StatResponse) {}
18
- }
@@ -1,12 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "ratelimit.proto";
6
-
7
- service RateLimitGRPC {
8
- // 限流KEY初始化
9
- rpc InitializeQuota(RateLimitRequest) returns(RateLimitResponse) {}
10
- // 获取限流配额
11
- rpc AcquireQuota(stream RateLimitRequest) returns(stream RateLimitResponse) {}
12
- }
@@ -1,39 +0,0 @@
1
- /// <reference types="node" />
2
- import { AxiosRequestConfig } from "axios";
3
- import * as http from "http";
4
- import type { BoxType, PolarisClient } from "../.."; /** only import type */
5
- import { PolarisServerAdapter, ServerAdapterOptions } from "../../adapter";
6
- import { ServiceType } from "../../types";
7
- import { ProtobufFormat } from "../../utils";
8
- declare const kDefaultOptions: {
9
- /**
10
- * 是否复用连接
11
- */
12
- keepAlive: boolean;
13
- /**
14
- * axios 配置项
15
- */
16
- axios: AxiosRequestConfig<any>;
17
- };
18
- export declare type PolarisHTTPClientOptions = typeof kDefaultOptions & ServerAdapterOptions;
19
- export declare class PolarisHTTPClient extends PolarisServerAdapter {
20
- static readonly protocol = "http";
21
- static readonly port = 8080;
22
- readonly name = "PolarisHTTPClient";
23
- readonly protocol = "http";
24
- readonly format = ProtobufFormat.JSON;
25
- protected readonly options: PolarisHTTPClientOptions;
26
- private sequence;
27
- constructor(remotes: string[], options?: Partial<PolarisHTTPClientOptions>);
28
- box<T>(value: T): BoxType<T> | T | null | undefined;
29
- unbox<T>(value: BoxType<T> | T | null | undefined, defaultValue: T | (() => T)): T;
30
- /**
31
- * 获取 axios.AxiosRequestConfig 配置,可重载此方法实现差异化配置
32
- * @param address 远端地址
33
- * @param name 远端类型
34
- * @param httpAgent http.Agent
35
- */
36
- protected getRequestConfig(address: string, name: string, httpAgent: http.Agent): AxiosRequestConfig;
37
- protected buildClient<T extends PolarisClient>(address: string, type: ServiceType): T;
38
- }
39
- export {};
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PolarisHTTPClient = void 0;
4
- const axios_1 = require("axios");
5
- const http = require("http");
6
- const __1 = require("../../../../..");
7
- const utils_1 = require("../../../../../utils");
8
- const adapter_1 = require("../../adapter");
9
- const types_1 = require("../../types");
10
- const utils_2 = require("../../utils");
11
- const kDefaultOptions = {
12
- /**
13
- * 是否复用连接
14
- */
15
- keepAlive: true,
16
- /**
17
- * axios 配置项
18
- */
19
- axios: {
20
- /**
21
- * 调用超时时间
22
- */
23
- timeout: 10 * utils_1.kSeconds
24
- }
25
- };
26
- const kUrlMapping = {
27
- [types_1.ServiceType.Monitor]: {
28
- collectServerStatistics: "/v1/CollectServerStatistics",
29
- collectServiceStatistics: "/v1/CollectServiceStatistics",
30
- collectCircuitBreak: "/v1/CollectCircuitBreak",
31
- collectSdkCache: "/v1/CollectSDKCache",
32
- collectSdkConfiguration: "/v1/collectSDKConfiguration",
33
- collectSdkapiStatistics: "/v1/CollectSDKAPIStatistics"
34
- },
35
- [types_1.ServiceType.Discover]: {
36
- discover: "/v1/Discover",
37
- registerInstance: "/v1/RegisterInstance",
38
- deregisterInstance: "/v1/DeregisterInstance",
39
- heartbeat: "/v1/Heartbeat",
40
- reportClient: "/v1/ReportClient"
41
- },
42
- [types_1.ServiceType.Ratelimit]: {
43
- acquireQuota: "/v1/AcquireQuota",
44
- initializeQuota: "/v1/InitializeQuota"
45
- }
46
- };
47
- const kUA = `${utils_1.kModuleName}/${utils_1.kModuleVersion} Node.js/${process.versions.node}`;
48
- class PolarisHTTPClient extends adapter_1.PolarisServerAdapter {
49
- constructor(remotes, options) {
50
- super(remotes, options);
51
- this.name = "PolarisHTTPClient";
52
- this.protocol = PolarisHTTPClient.protocol;
53
- this.format = utils_2.ProtobufFormat.JSON;
54
- this.sequence = 0;
55
- this.options = Object.assign(Object.assign(Object.assign(Object.assign({}, this.options), kDefaultOptions), options), { axios: Object.assign(Object.assign(Object.assign({}, this.options.axios), kDefaultOptions.axios), options === null || options === void 0 ? void 0 : options.axios) });
56
- }
57
- box(value) {
58
- return value;
59
- }
60
- unbox(value, defaultValue) {
61
- const val = value;
62
- if (typeof val !== "undefined" && val !== null) {
63
- return val;
64
- }
65
- if (typeof defaultValue === "function") {
66
- return defaultValue();
67
- }
68
- return defaultValue;
69
- }
70
- // #region #AOP#
71
- /**
72
- * 获取 axios.AxiosRequestConfig 配置,可重载此方法实现差异化配置
73
- * @param address 远端地址
74
- * @param name 远端类型
75
- * @param httpAgent http.Agent
76
- */
77
- getRequestConfig(address, name, httpAgent) {
78
- const { options: { axios: axiosOptions } } = this;
79
- return Object.assign({ headers: Object.assign({ "User-Agent": kUA, "Request-Id": `${this.sequence++}` }, axiosOptions.headers),
80
- /**
81
- * 由于后端接口为 `RESTful` 架构,
82
- * 故在在此放过所有 `StatusCode`,具体判断由业务层处理
83
- */
84
- validateStatus: () => true, httpAgent }, axiosOptions);
85
- }
86
- // #endregion
87
- buildClient(address, type) {
88
- const { logger } = this;
89
- const { transaction } = logger;
90
- logger.trace("Plugins" /* Plugins */, this.name, "buildClient", transaction, "remote address is", address, "and type is", type);
91
- const mapping = kUrlMapping[type];
92
- const client = Object.create(null);
93
- const httpAgent = new http.Agent({
94
- keepAlive: this.options.keepAlive
95
- });
96
- for (const name of Object.keys(mapping)) {
97
- client[name] = async (request) => {
98
- const { data } = await axios_1.default.post(`http://${address}${mapping[name]}`, request, this.getRequestConfig(address, name, httpAgent));
99
- if (!data || typeof data !== "object") {
100
- throw new __1.InvalidResponse(`Parsing response data, expect object but received ${typeof data}`);
101
- }
102
- return data;
103
- };
104
- }
105
- client.close = () => {
106
- logger.trace("Plugins" /* Plugins */, this.name, "buildClient", transaction, "destroy http agent");
107
- httpAgent.destroy();
108
- };
109
- return client;
110
- }
111
- }
112
- exports.PolarisHTTPClient = PolarisHTTPClient;
113
- PolarisHTTPClient.protocol = "http";
114
- PolarisHTTPClient.port = 8080;
115
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/plugins/naming/polaris-server/connector/http/index.ts"],"names":[],"mappings":";;;AAAA,iCAAkD;AAClD,6BAA6B;AAE7B,sCAAgE;AAChE,gDAA6E;AAE7E,2CAA2E;AAC3E,uCA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AM,SAAS,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC;YAC/B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;SAClC,CAAC,CAAC;QAEH,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;YACvC,MAAM,CAAC,IAAwB,CAAC,GAAG,KAAK,EAAqB,OAAgB,EAAqB,EAAE;gBAClG,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,eAAK,CAAC,IAAI,CAC/B,UAAU,OAAO,GAAI,OAAkC,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EACxE,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAChD,CAAC;gBAEF,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;oBACrC,MAAM,IAAI,mBAAe,CAAC,qDAAqD,OAAO,IAAI,EAAE,CAAC,CAAC;iBAC/F;gBAED,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAEA,MAAY,CAAC,KAAK,GAAG,GAAG,EAAE;YACzB,MAAM,CAAC,KAAK,0BAAwB,IAAI,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,oBAAoB,CAAC,CAAC;YACjG,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC,CAAC;QAEF,OAAO,MAAW,CAAC;IACrB,CAAC;;AAtGH,8CAuGC;AAtGiB,0BAAQ,GAAG,MAAM,CAAC;AAClB,sBAAI,GAAG,IAAI,CAAC"}
@@ -1,24 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "client.proto";
6
- import "service.proto";
7
- import "request.proto";
8
- import "response.proto";
9
-
10
- service ServerAPI {
11
- // 客户端上报
12
- rpc ReportClient(Client) returns(Response) {}
13
-
14
- // 被调方注册服务实例
15
- rpc RegisterInstance(Instance) returns(Response) {}
16
- // 被调方反注册服务实例
17
- rpc DeregisterInstance(Instance) returns(Response) {}
18
-
19
- // 统一发现接口
20
- rpc Discover(stream DiscoverRequest) returns(stream DiscoverResponse) {}
21
-
22
- // 被调方上报心跳
23
- rpc Heartbeat(Instance) returns(Response) {}
24
- }
@@ -1,22 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "google/protobuf/wrappers.proto";
6
- import "model.proto";
7
-
8
- message Client {
9
- google.protobuf.StringValue host = 1;
10
-
11
- enum ClientType {
12
- UNKNOWN = 0;
13
- SDK = 1;
14
- AGENT = 2;
15
- }
16
-
17
- ClientType type = 2;
18
-
19
- google.protobuf.StringValue version = 3;
20
-
21
- Location location = 4;
22
- }
@@ -1,28 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "google/protobuf/wrappers.proto";
6
-
7
- message Location {
8
- google.protobuf.StringValue region = 1;
9
- google.protobuf.StringValue zone = 2;
10
- google.protobuf.StringValue campus = 3;
11
- }
12
-
13
- message MatchString {
14
- enum MatchStringType {
15
- EXACT = 0;
16
- REGEX = 1;
17
- }
18
-
19
- enum ValueType {
20
- TEXT = 0;
21
- PARAMETER = 1;
22
- VARIABLE = 2;
23
- }
24
-
25
- MatchStringType type = 1;
26
- google.protobuf.StringValue value = 2;
27
- ValueType value_type = 3;
28
- }
@@ -1,80 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "google/protobuf/wrappers.proto";
6
- import "google/protobuf/duration.proto";
7
- import "model.proto";
8
-
9
- // 同一服务下限流规则集合
10
- message RateLimit {
11
- // 限流规则集合
12
- repeated Rule rules = 1;
13
- // 限流规则汇总的revision信息
14
- google.protobuf.StringValue revision = 2;
15
- }
16
-
17
- // 单个限流规则信息
18
- message Rule {
19
- // 限流规则唯一标识
20
- google.protobuf.StringValue id = 1;
21
- // 限流规则所属服务名
22
- google.protobuf.StringValue service = 2;
23
- // 限流规则所属命名空间
24
- google.protobuf.StringValue namespace = 3;
25
- // 限流规则所属集群名
26
- google.protobuf.StringValue cluster = 4;
27
- // 限流规则优先级,0值最高
28
- google.protobuf.UInt32Value priority = 5;
29
- // 限流资源
30
- enum Resource {
31
- // 针对QPS进行限流
32
- QPS = 0;
33
- // 针对并发数进行限流
34
- CONCURRENCY = 1;
35
- }
36
- Resource resource = 6;
37
- // 限流类型
38
- // global全局限流(默认)或者local单机限流
39
- enum Type {
40
- GLOBAL = 0;
41
- LOCAL = 1;
42
- }
43
- Type type = 7;
44
- // 业务标签集合,通过KV进行匹配,匹配到一个则使用该规则
45
- map<string, MatchString> labels = 8;
46
- // 限流阈值
47
- // 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流
48
- // 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量
49
- repeated Amount amounts = 9;
50
- // 限流动作,对应着客户端的插件名字
51
- google.protobuf.StringValue action = 10;
52
- // 是否停用该限流规则,默认启用
53
- google.protobuf.BoolValue disable = 11;
54
- // 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报
55
- Report report = 12;
56
- // 限流规则创建时间
57
- google.protobuf.StringValue ctime = 13;
58
- // 限流规则修改时间
59
- google.protobuf.StringValue mtime = 14;
60
- // 限流规则revision信息
61
- google.protobuf.StringValue revision = 15;
62
- // 服务的TOKEN信息,仅用于控制台,discover接口不下发
63
- google.protobuf.StringValue service_token = 16 [json_name="service_token"];
64
- }
65
-
66
- // 限流配额
67
- message Amount {
68
- // 时间周期内的最大配额数
69
- google.protobuf.UInt32Value maxAmount = 1;
70
- // 配额生效的时间周期,必须大于等于1s
71
- google.protobuf.Duration validDuration = 2;
72
- }
73
-
74
- // 限流上报方式
75
- message Report {
76
- // 配额固定上报周期,单位毫秒
77
- google.protobuf.Duration interval = 1;
78
- // 使用了百分之多少配额后启动一次实时上报,值范围(0,100]
79
- google.protobuf.UInt32Value amountPercent = 2;
80
- }
@@ -1,18 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package v1;
4
-
5
- import "service.proto";
6
-
7
- message DiscoverRequest {
8
- enum DiscoverRequestType {
9
- UNKNOWN = 0;
10
- INSTANCE = 1;
11
- CLUSTER = 2;
12
- ROUTING = 3;
13
- RATE_LIMIT = 4;
14
- }
15
-
16
- DiscoverRequestType type = 1;
17
- Service service = 2;
18
- }