@tencent-rtc/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.
- package/package.json +1 -1
- package/resource/doc/chatuikit/faq/common/server_error_code.md +74 -0
- package/resource/doc/chatuikit/faq/web_sdk/error_code.md +47 -0
- package/resource/doc/chatuikit/faq/web_sdk/faq.md +105 -0
- package/resource/doc/chatuikit/flutter/faq.md +120 -0
- package/resource/doc/chatuikit/iOS/faq.md +120 -0
- package/resource/doc/chatuikit/react/faq.md +26 -0
- package/resource/doc/chatuikit/vue/faq.md +36 -0
- package/resource/doc/livekit/faq/common/error_code.md +88 -0
- package/resource/doc/livekit/vue/faq.md +0 -0
- package/resource/doc/roomkit/faq/common/error_code.md +67 -0
- package/resource/doc/roomkit/vue/faq.md +0 -0
- package/resource/doc/rtcengine/faq/common/error_code.md +0 -0
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/tuicallkit/faq/common/error_code.md +47 -0
- package/resource/doc/tuicallkit/flutter/faq.md +127 -0
- package/resource/doc/tuicallkit/iOS/faq.md +127 -0
- package/resource/doc/tuicallkit/react/faq.md +36 -0
- package/resource/doc/tuicallkit/vue/faq.md +36 -0
- package/tools/call/get-native-call-integration.js +4 -10
- package/tools/call/get-native-call-integration.js.map +1 -1
- package/tools/call/get-web-call-api.js +4 -7
- package/tools/call/get-web-call-api.js.map +1 -1
- package/tools/call/get-web-call-integration.js +4 -9
- package/tools/call/get-web-call-integration.js.map +1 -1
- package/tools/chat/get-native-chat-integration.js +4 -9
- package/tools/chat/get-native-chat-integration.js.map +1 -1
- package/tools/chat/get-web-chat-component-detail.js +5 -10
- package/tools/chat/get-web-chat-component-detail.js.map +1 -1
- package/tools/chat/get-web-chat-integration.js +4 -12
- package/tools/chat/get-web-chat-integration.js.map +1 -1
- package/tools/chat/get-web-chat-uikit-init.js +5 -6
- package/tools/chat/get-web-chat-uikit-init.js.map +1 -1
- package/tools/chat/get-web-chat-window-integration.js +4 -12
- package/tools/chat/get-web-chat-window-integration.js.map +1 -1
- package/tools/chat/{create-group.js → get-web-create-group-doc.js} +5 -6
- package/tools/chat/get-web-create-group-doc.js.map +1 -0
- package/tools/common/get-faq.js +93 -0
- package/tools/common/get-faq.js.map +1 -0
- package/tools/common/get-usersig.js +9 -18
- package/tools/common/get-usersig.js.map +1 -1
- package/tools/common/present-framework-choice.js +3 -10
- package/tools/common/present-framework-choice.js.map +1 -1
- package/tools/common/record-prompt.js +5 -11
- package/tools/common/record-prompt.js.map +1 -1
- package/tools/common/record-result.js +8 -12
- package/tools/common/record-result.js.map +1 -1
- package/tools/definitions/get_faq_def.js +28 -0
- package/tools/definitions/get_faq_def.js.map +1 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +21 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js +21 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -0
- package/tools/definitions/get_usersig_def.js +32 -0
- package/tools/definitions/get_usersig_def.js.map +1 -0
- package/tools/definitions/get_web_call_uikit_api_def.js +23 -0
- package/tools/definitions/get_web_call_uikit_api_def.js.map +1 -0
- package/tools/definitions/get_web_call_uikit_integration_def.js +20 -0
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +24 -0
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_init_def.js +23 -0
- package/tools/definitions/get_web_chat_uikit_init_def.js.map +1 -0
- package/tools/definitions/get_web_chat_uikit_integration_def.js +26 -0
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -0
- package/tools/definitions/get_web_chat_window_integration_def.js +26 -0
- package/tools/definitions/get_web_chat_window_integration_def.js.map +1 -0
- package/tools/definitions/get_web_create_group_doc_def.js +18 -0
- package/tools/definitions/get_web_create_group_doc_def.js.map +1 -0
- package/tools/definitions/get_web_live_state_detail_def.js +19 -0
- package/tools/definitions/get_web_live_state_detail_def.js.map +1 -0
- package/tools/definitions/get_web_live_uikit_component_detail_def.js +22 -0
- package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +1 -0
- package/tools/definitions/get_web_room_state_detail_def.js +19 -0
- package/tools/definitions/get_web_room_state_detail_def.js.map +1 -0
- package/tools/definitions/present_framework_choice_def.js +23 -0
- package/tools/definitions/present_framework_choice_def.js.map +1 -0
- package/tools/definitions/record_prompt_def.js +22 -0
- package/tools/definitions/record_prompt_def.js.map +1 -0
- package/tools/definitions/record_result_def.js +22 -0
- package/tools/definitions/record_result_def.js.map +1 -0
- package/tools/index.js +13 -11
- package/tools/index.js.map +1 -1
- package/tools/live/get-web-live-component-detail.js +5 -7
- package/tools/live/get-web-live-component-detail.js.map +1 -1
- package/tools/live/get-web-live-state-detail.js +5 -7
- package/tools/live/get-web-live-state-detail.js.map +1 -1
- package/tools/room/get-web-room-state-detail.js +5 -7
- package/tools/room/get-web-room-state-detail.js.map +1 -1
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js +28 -0
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-api.js +28 -0
- package/tools/rtcengine/get-trtc-web-sdk-api.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-faq.js +2 -3
- package/tools/rtcengine/get-trtc-web-sdk-faq.js.map +1 -1
- package/tools/rtcengine/get-trtc-web-sdk-integration.js +29 -0
- package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +1 -0
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
- package/libs/@tencent/aegis-node-sdk/LICENSE +0 -21
- package/libs/@tencent/aegis-node-sdk/README.md +0 -562
- package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
- package/libs/@tencent/aegis-node-sdk/package.json +0 -19
- package/libs/@tencent/polaris/README.md +0 -407
- package/libs/@tencent/polaris/dist/consumer/health.d.ts +0 -126
- package/libs/@tencent/polaris/dist/consumer/health.js +0 -283
- package/libs/@tencent/polaris/dist/consumer/health.js.map +0 -1
- package/libs/@tencent/polaris/dist/consumer/index.d.ts +0 -120
- package/libs/@tencent/polaris/dist/consumer/index.js +0 -348
- package/libs/@tencent/polaris/dist/consumer/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
- package/libs/@tencent/polaris/dist/consumer/monitor.js +0 -343
- package/libs/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
- package/libs/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
- package/libs/@tencent/polaris/dist/consumer/selector.js +0 -316
- package/libs/@tencent/polaris/dist/consumer/selector.js.map +0 -1
- package/libs/@tencent/polaris/dist/errors.d.ts +0 -373
- package/libs/@tencent/polaris/dist/errors.js +0 -154
- package/libs/@tencent/polaris/dist/errors.js.map +0 -1
- package/libs/@tencent/polaris/dist/global.d.ts +0 -16
- package/libs/@tencent/polaris/dist/global.js +0 -18
- package/libs/@tencent/polaris/dist/global.js.map +0 -1
- package/libs/@tencent/polaris/dist/index.d.ts +0 -62
- package/libs/@tencent/polaris/dist/index.js +0 -145
- package/libs/@tencent/polaris/dist/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/instance.d.ts +0 -109
- package/libs/@tencent/polaris/dist/instance.js +0 -38
- package/libs/@tencent/polaris/dist/instance.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
- package/libs/@tencent/polaris/dist/limiter/bucket.js +0 -152
- package/libs/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/index.d.ts +0 -73
- package/libs/@tencent/polaris/dist/limiter/index.js +0 -149
- package/libs/@tencent/polaris/dist/limiter/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
- package/libs/@tencent/polaris/dist/location.d.ts +0 -48
- package/libs/@tencent/polaris/dist/location.js +0 -67
- package/libs/@tencent/polaris/dist/location.js.map +0 -1
- package/libs/@tencent/polaris/dist/logging.d.ts +0 -106
- package/libs/@tencent/polaris/dist/logging.js +0 -130
- package/libs/@tencent/polaris/dist/logging.js.map +0 -1
- package/libs/@tencent/polaris/dist/metadata.d.ts +0 -78
- package/libs/@tencent/polaris/dist/metadata.js +0 -119
- package/libs/@tencent/polaris/dist/metadata.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
- package/libs/@tencent/polaris/dist/plugins/lb/base.js +0 -32
- package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
- package/libs/@tencent/polaris/dist/plugins/logging/console.js +0 -38
- package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
- package/libs/@tencent/polaris/dist/plugins.d.ts +0 -619
- package/libs/@tencent/polaris/dist/plugins.js +0 -91
- package/libs/@tencent/polaris/dist/plugins.js.map +0 -1
- package/libs/@tencent/polaris/dist/polaris.d.ts +0 -33
- package/libs/@tencent/polaris/dist/polaris.js +0 -59
- package/libs/@tencent/polaris/dist/polaris.js.map +0 -1
- package/libs/@tencent/polaris/dist/provider/index.d.ts +0 -102
- package/libs/@tencent/polaris/dist/provider/index.js +0 -168
- package/libs/@tencent/polaris/dist/provider/index.js.map +0 -1
- package/libs/@tencent/polaris/dist/registry.d.ts +0 -174
- package/libs/@tencent/polaris/dist/registry.js +0 -660
- package/libs/@tencent/polaris/dist/registry.js.map +0 -1
- package/libs/@tencent/polaris/dist/rules.d.ts +0 -163
- package/libs/@tencent/polaris/dist/rules.js +0 -24
- package/libs/@tencent/polaris/dist/rules.js.map +0 -1
- package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
- package/libs/@tencent/polaris/dist/scripts/postinstall.js +0 -71
- package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
- package/libs/@tencent/polaris/dist/service.d.ts +0 -18
- package/libs/@tencent/polaris/dist/service.js +0 -3
- package/libs/@tencent/polaris/dist/service.js.map +0 -1
- package/libs/@tencent/polaris/dist/skeleton.d.ts +0 -87
- package/libs/@tencent/polaris/dist/skeleton.js +0 -282
- package/libs/@tencent/polaris/dist/skeleton.js.map +0 -1
- package/libs/@tencent/polaris/dist/utils.d.ts +0 -36
- package/libs/@tencent/polaris/dist/utils.js +0 -74
- package/libs/@tencent/polaris/dist/utils.js.map +0 -1
- package/libs/@tencent/polaris/dist/weak.d.ts +0 -11
- package/libs/@tencent/polaris/dist/weak.js +0 -44
- package/libs/@tencent/polaris/dist/weak.js.map +0 -1
- package/libs/@tencent/polaris/package.json +0 -114
- package/resource/doc/chatuikit/faq/generate_UserSig.md +0 -306
- package/tools/call/get-call-faq.js +0 -29
- package/tools/call/get-call-faq.js.map +0 -1
- package/tools/chat/create-group.js.map +0 -1
- package/tools/chat/get-chat-faq.js +0 -29
- package/tools/chat/get-chat-faq.js.map +0 -1
- package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js +0 -34
- package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js.map +0 -1
- package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js +0 -35
- package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js.map +0 -1
- /package/resource/doc/chatuikit/{faq/faq_sdk.md → android/faq.md} +0 -0
- /package/{libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts → resource/doc/chatuikit/faq/native_sdk/faq.md} +0 -0
- /package/resource/doc/rtcengine/faq/{web.md → web/web.md} +0 -0
- /package/resource/doc/rtcengine/web/{api_RTCEngine.md → api.md} +0 -0
- /package/resource/doc/rtcengine/web/{how_to_integrated_web_rtc_engine.md → how_to_integrated_web_sdk.md} +0 -0
- /package/resource/doc/rtcengine/web/{how_to_run_web_rtc_engine_demo.md → how_to_run_web_sdk_demo.md} +0 -0
- /package/resource/doc/tuicallkit/{faq → android}/faq.md +0 -0
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Instance, InstanceStatus } from "../instance";
|
|
2
|
-
import { Location } from "../location";
|
|
3
|
-
import { Logger } from "../logging";
|
|
4
|
-
import { Metadata } from "../metadata";
|
|
5
|
-
import { LoadBalancerPlugin, OutlierDetectorPlugin, StatReporterPlugin } from "../plugins";
|
|
6
|
-
import { LocalRegistry } from "../registry";
|
|
7
|
-
declare const kDefaultOptions: {
|
|
8
|
-
/**
|
|
9
|
-
* 检查间隔
|
|
10
|
-
*
|
|
11
|
-
* 此值确定了,探活子系统的最小分辨率
|
|
12
|
-
*/
|
|
13
|
-
detectInterval: number;
|
|
14
|
-
/**
|
|
15
|
-
* 熔断超时时间
|
|
16
|
-
*
|
|
17
|
-
* 未配置任何探活模块时生效
|
|
18
|
-
*/
|
|
19
|
-
fusingTimeout: number;
|
|
20
|
-
/**
|
|
21
|
-
* 状态变更上报间隔
|
|
22
|
-
*/
|
|
23
|
-
reportInterval: number;
|
|
24
|
-
/**
|
|
25
|
-
* 状态变更上报阈值
|
|
26
|
-
*/
|
|
27
|
-
reportThreshold: number;
|
|
28
|
-
};
|
|
29
|
-
export declare type HealthOptions = typeof kDefaultOptions;
|
|
30
|
-
/**
|
|
31
|
-
* 实例集合的共同信息
|
|
32
|
-
*/
|
|
33
|
-
export interface IntersectionInstance {
|
|
34
|
-
location: Location;
|
|
35
|
-
metadata: Metadata;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 状态变更历史
|
|
39
|
-
*/
|
|
40
|
-
export interface StatusChangelog {
|
|
41
|
-
/**
|
|
42
|
-
* 各实例状态变更历史
|
|
43
|
-
*/
|
|
44
|
-
status: Map<Instance, StatusLog[]>;
|
|
45
|
-
/**
|
|
46
|
-
* 全局 `全死 ---> 全活` 变更历史
|
|
47
|
-
*/
|
|
48
|
-
recover: RecoverLog[];
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* 全死 ---> 全活变更记录
|
|
52
|
-
*/
|
|
53
|
-
export interface RecoverLog {
|
|
54
|
-
/**
|
|
55
|
-
* 发生时间 (ms)
|
|
56
|
-
*/
|
|
57
|
-
time: number;
|
|
58
|
-
/**
|
|
59
|
-
* 实例集合的共同信息
|
|
60
|
-
*/
|
|
61
|
-
intersection: IntersectionInstance;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* 实例状态变更请求
|
|
65
|
-
*/
|
|
66
|
-
export interface StatusChangeRequest {
|
|
67
|
-
/**
|
|
68
|
-
* 变更后(目标)状态
|
|
69
|
-
*/
|
|
70
|
-
status: InstanceStatus;
|
|
71
|
-
/**
|
|
72
|
-
* 变更原因
|
|
73
|
-
*/
|
|
74
|
-
reason: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 实例状态变更记录
|
|
78
|
-
*/
|
|
79
|
-
export interface StatusLog {
|
|
80
|
-
/**
|
|
81
|
-
* 变更时间 (ms)
|
|
82
|
-
*/
|
|
83
|
-
time: number;
|
|
84
|
-
/**
|
|
85
|
-
* 变更前(原)状态
|
|
86
|
-
*/
|
|
87
|
-
before: InstanceStatus;
|
|
88
|
-
/**
|
|
89
|
-
* 变更后(目标)状态
|
|
90
|
-
*/
|
|
91
|
-
after: InstanceStatus;
|
|
92
|
-
/**
|
|
93
|
-
* 变更原因
|
|
94
|
-
*/
|
|
95
|
-
reason: string;
|
|
96
|
-
}
|
|
97
|
-
export declare class Health {
|
|
98
|
-
private readonly logger;
|
|
99
|
-
private readonly registry;
|
|
100
|
-
private readonly lb;
|
|
101
|
-
private readonly detectors;
|
|
102
|
-
private readonly reporters;
|
|
103
|
-
private detectTimer;
|
|
104
|
-
private reportTimer;
|
|
105
|
-
private readonly pending;
|
|
106
|
-
private readonly options;
|
|
107
|
-
private history;
|
|
108
|
-
private countOfHistory;
|
|
109
|
-
private readonly needReport;
|
|
110
|
-
private disposed;
|
|
111
|
-
constructor(logger: Logger, registry: LocalRegistry, lb: LoadBalancerPlugin, detectors: OutlierDetectorPlugin[], reporters: StatReporterPlugin[], options?: Partial<HealthOptions>);
|
|
112
|
-
dispose(): void;
|
|
113
|
-
changeStatus(namespace: string, service: string, collections: Map<Instance, StatusChangeRequest>): void; /** batch - for performance */
|
|
114
|
-
changeStatus(namespace: string, service: string, instance: Instance, status: InstanceStatus, reason: string): void; /** single - for convenient */
|
|
115
|
-
recoverAll(namespace: string, service: string, instances: Instance[]): void;
|
|
116
|
-
private scheduleReport;
|
|
117
|
-
private report;
|
|
118
|
-
private getServiceChangelog;
|
|
119
|
-
private performStatusChange;
|
|
120
|
-
private detect;
|
|
121
|
-
private procDetectResult;
|
|
122
|
-
private successfulDetection;
|
|
123
|
-
private detectInstance;
|
|
124
|
-
private run;
|
|
125
|
-
}
|
|
126
|
-
export {};
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Health = void 0;
|
|
4
|
-
const location_1 = require("../location");
|
|
5
|
-
const metadata_1 = require("../metadata");
|
|
6
|
-
const plugins_1 = require("../plugins");
|
|
7
|
-
const utils_1 = require("../utils");
|
|
8
|
-
const kDefaultOptions = {
|
|
9
|
-
/**
|
|
10
|
-
* 检查间隔
|
|
11
|
-
*
|
|
12
|
-
* 此值确定了,探活子系统的最小分辨率
|
|
13
|
-
*/
|
|
14
|
-
detectInterval: 10 * utils_1.kSeconds,
|
|
15
|
-
/**
|
|
16
|
-
* 熔断超时时间
|
|
17
|
-
*
|
|
18
|
-
* 未配置任何探活模块时生效
|
|
19
|
-
*/
|
|
20
|
-
fusingTimeout: 5 * utils_1.kSeconds,
|
|
21
|
-
/**
|
|
22
|
-
* 状态变更上报间隔
|
|
23
|
-
*/
|
|
24
|
-
reportInterval: 5 * utils_1.kMinutes,
|
|
25
|
-
/**
|
|
26
|
-
* 状态变更上报阈值
|
|
27
|
-
*/
|
|
28
|
-
reportThreshold: 10000
|
|
29
|
-
};
|
|
30
|
-
class Health {
|
|
31
|
-
constructor(logger, registry, lb, detectors, reporters, options) {
|
|
32
|
-
this.logger = logger;
|
|
33
|
-
this.registry = registry;
|
|
34
|
-
this.lb = lb;
|
|
35
|
-
this.detectors = detectors;
|
|
36
|
-
this.reporters = reporters;
|
|
37
|
-
this.pending = new WeakSet();
|
|
38
|
-
this.history = Object.create(null);
|
|
39
|
-
this.countOfHistory = 0;
|
|
40
|
-
this.disposed = false;
|
|
41
|
-
this.options = Object.assign(Object.assign({}, kDefaultOptions), options);
|
|
42
|
-
this.needReport = reporters.some(report => typeof report.statusChangelog === "function");
|
|
43
|
-
this.run();
|
|
44
|
-
}
|
|
45
|
-
dispose() {
|
|
46
|
-
if (this.reportTimer) {
|
|
47
|
-
clearTimeout(this.reportTimer);
|
|
48
|
-
this.reportTimer = undefined;
|
|
49
|
-
}
|
|
50
|
-
if (this.detectTimer) {
|
|
51
|
-
clearTimeout(this.detectTimer);
|
|
52
|
-
this.detectTimer = undefined;
|
|
53
|
-
}
|
|
54
|
-
this.disposed = true;
|
|
55
|
-
}
|
|
56
|
-
/* eslint-enable max-len */
|
|
57
|
-
changeStatus(namespace, service, ...args) {
|
|
58
|
-
if (this.disposed) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const statusLogger = this.needReport ? this.getServiceChangelog(namespace, service).status : undefined;
|
|
62
|
-
if (args.length === 1) {
|
|
63
|
-
args[0].forEach((change, instance) => {
|
|
64
|
-
this.performStatusChange(namespace, service, instance, change.status, change.reason, statusLogger);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
this.performStatusChange(namespace, service, args[0], args[1], args[2], statusLogger);
|
|
69
|
-
}
|
|
70
|
-
if (this.needReport) {
|
|
71
|
-
this.scheduleReport();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
recoverAll(namespace, service, instances) {
|
|
75
|
-
if (this.disposed || !this.needReport) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
let intersection;
|
|
79
|
-
instances.forEach((instance) => {
|
|
80
|
-
if (instance.status !== 0 /* Normal */) {
|
|
81
|
-
/**
|
|
82
|
-
* 计算实例相交的部分
|
|
83
|
-
*/
|
|
84
|
-
if (intersection === undefined) {
|
|
85
|
-
intersection = {
|
|
86
|
-
location: instance.location,
|
|
87
|
-
metadata: instance.metadata
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
if (!(0, location_1.isEmptyLocation)(intersection.location)) {
|
|
92
|
-
intersection.location = (0, location_1.intersectionLocation)(intersection.location, instance.location);
|
|
93
|
-
}
|
|
94
|
-
if (!(0, metadata_1.isEmptyMetadata)(intersection.metadata)) {
|
|
95
|
-
intersection.metadata = (0, metadata_1.intersectionMetadata)(intersection.metadata, instance.metadata);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
if (intersection !== undefined) {
|
|
101
|
-
this.getServiceChangelog(namespace, service).recover.push({
|
|
102
|
-
intersection,
|
|
103
|
-
time: Date.now()
|
|
104
|
-
});
|
|
105
|
-
this.countOfHistory += 1;
|
|
106
|
-
this.scheduleReport();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
scheduleReport() {
|
|
110
|
-
if (this.countOfHistory >= this.options.reportThreshold) {
|
|
111
|
-
if (this.reportTimer !== undefined) {
|
|
112
|
-
clearTimeout(this.reportTimer);
|
|
113
|
-
this.reportTimer = undefined;
|
|
114
|
-
}
|
|
115
|
-
this.report();
|
|
116
|
-
}
|
|
117
|
-
else if (this.reportTimer === undefined) {
|
|
118
|
-
this.reportTimer = setTimeout(() => {
|
|
119
|
-
this.reportTimer = undefined;
|
|
120
|
-
this.report();
|
|
121
|
-
}, this.options.reportInterval).unref();
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
report() {
|
|
125
|
-
const { history } = this;
|
|
126
|
-
this.history = Object.create(null);
|
|
127
|
-
this.countOfHistory = 0;
|
|
128
|
-
Object.keys(history).forEach((namespace) => {
|
|
129
|
-
const serviceHistory = history[namespace];
|
|
130
|
-
Object.keys(serviceHistory).forEach((service) => {
|
|
131
|
-
this.reporters.forEach((reporter) => {
|
|
132
|
-
var _a;
|
|
133
|
-
(_a = reporter.statusChangelog) === null || _a === void 0 ? void 0 : _a.call(reporter, namespace, service, serviceHistory[service]).catch(err => this.disposed || this.logger.error(`[${reporter.name}] [statusChangelog]`, err));
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
getServiceChangelog(namespace, service) {
|
|
139
|
-
let ns = this.history[namespace];
|
|
140
|
-
if (!ns) {
|
|
141
|
-
ns = Object.create(null);
|
|
142
|
-
this.history[namespace] = ns;
|
|
143
|
-
}
|
|
144
|
-
let changelog = ns[service];
|
|
145
|
-
if (!changelog) {
|
|
146
|
-
changelog = {
|
|
147
|
-
recover: [],
|
|
148
|
-
status: new Map()
|
|
149
|
-
};
|
|
150
|
-
ns[service] = changelog;
|
|
151
|
-
}
|
|
152
|
-
return changelog;
|
|
153
|
-
}
|
|
154
|
-
performStatusChange(namespace, service, instance, status, reason, statusLogger) {
|
|
155
|
-
var _a, _b;
|
|
156
|
-
if (instance.status === status) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
const before = instance.status;
|
|
160
|
-
if (statusLogger !== undefined) {
|
|
161
|
-
let statusHistory = statusLogger.get(instance);
|
|
162
|
-
if (statusHistory === undefined) {
|
|
163
|
-
statusHistory = [];
|
|
164
|
-
statusLogger.set(instance, statusHistory);
|
|
165
|
-
}
|
|
166
|
-
statusHistory.push({
|
|
167
|
-
time: Date.now(),
|
|
168
|
-
after: status,
|
|
169
|
-
before,
|
|
170
|
-
reason
|
|
171
|
-
});
|
|
172
|
-
this.countOfHistory += 1;
|
|
173
|
-
}
|
|
174
|
-
instance.status = status;
|
|
175
|
-
(_b = (_a = this.lb).onStatusChange) === null || _b === void 0 ? void 0 : _b.call(_a, namespace, service, instance, before);
|
|
176
|
-
}
|
|
177
|
-
// #endregion
|
|
178
|
-
// #region detector
|
|
179
|
-
async detect() {
|
|
180
|
-
const promises = [];
|
|
181
|
-
const instanceStorage = this.registry.local(plugins_1.RegistryCategory.Instance);
|
|
182
|
-
for (const namespace of Object.keys(instanceStorage)) {
|
|
183
|
-
const namespaceInstance = instanceStorage[namespace];
|
|
184
|
-
for (const service of Object.keys(namespaceInstance)) {
|
|
185
|
-
const instances = namespaceInstance[service].data;
|
|
186
|
-
for (const instance of instances) {
|
|
187
|
-
if (instance.status === 3 /* Fused */ && !this.pending.has(instance)) {
|
|
188
|
-
instance.dynamicWeight = 0;
|
|
189
|
-
promises.push(this.detectInstance(instance)
|
|
190
|
-
.then(result => this.procDetectResult(namespace, service, instance, result), err => this.logger.error("[health] [detect]", err)));
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
await Promise.all(promises);
|
|
196
|
-
}
|
|
197
|
-
procDetectResult(namespace, service, instance, result) {
|
|
198
|
-
if (instance.status !== 3 /* Fused */) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
const totalDetectors = this.detectors.length;
|
|
202
|
-
/**
|
|
203
|
-
* 根据所有探活模块的探测结果切换当前实例状态:
|
|
204
|
-
* * 成功:`Fused` ==(立即)==> `HalfOpen`
|
|
205
|
-
* * 未知:`Fused` ==(fusingTimeout)==> `HalfOpen`
|
|
206
|
-
* * 失败:保持当前实例状态,等待下次继续探测
|
|
207
|
-
*/
|
|
208
|
-
switch (result) {
|
|
209
|
-
case 0 /* Success */: {
|
|
210
|
-
this.successfulDetection(namespace, service, instance, `[health] [detect], one of detectors(${totalDetectors}) successfully detected`);
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
case 2 /* Other */: {
|
|
214
|
-
setTimeout(() => {
|
|
215
|
-
this.successfulDetection(namespace, service, instance, `[health] [detect], ${totalDetectors > 0 ? `one of detectors(${totalDetectors}) detected result is unknown, and ` : ""}has exceeded the fusing timeout(${this.options.fusingTimeout}ms)`);
|
|
216
|
-
}, this.options.fusingTimeout).unref();
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
case 1 /* Failure */: {
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
222
|
-
default: {
|
|
223
|
-
(0, utils_1.UNREACHABLE)();
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
successfulDetection(namespace, service, instance, reason) {
|
|
228
|
-
/**
|
|
229
|
-
* 由于为异步探活,实例状态可能已被其它模块修改,
|
|
230
|
-
* 如果当前状态不为 `Fused` 则不进行切换。
|
|
231
|
-
*/
|
|
232
|
-
if (instance.status === 3 /* Fused */) {
|
|
233
|
-
this.changeStatus(namespace, service, instance, 1 /* HalfOpen */, reason);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
async detectInstance(instance) {
|
|
237
|
-
const totalDetectors = this.detectors.length;
|
|
238
|
-
for (let i = 0; i < totalDetectors; i += 1) {
|
|
239
|
-
const result = await this.detectors[i].detect(instance);
|
|
240
|
-
switch (result) {
|
|
241
|
-
case 1 /* Failure */:
|
|
242
|
-
case 2 /* Other */: {
|
|
243
|
-
return result;
|
|
244
|
-
}
|
|
245
|
-
case 0 /* Success */: {
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
default: {
|
|
249
|
-
(0, utils_1.UNREACHABLE)();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (totalDetectors > 0) {
|
|
254
|
-
return 0 /* Success */;
|
|
255
|
-
}
|
|
256
|
-
return 2 /* Other */;
|
|
257
|
-
}
|
|
258
|
-
run() {
|
|
259
|
-
if (this.detectTimer) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
/*
|
|
263
|
-
* 为了性能考虑 `Health` 流程采用同一定时器驱动
|
|
264
|
-
* tradeoff:
|
|
265
|
-
* 在最坏的情况下(未配置任何探活模块时),
|
|
266
|
-
* 由 `Fused` ---> `Normal` 至少需要等待 `detectInterval + fusingTimeout`
|
|
267
|
-
* 而非 `fusingTimeout` 中指定的值。
|
|
268
|
-
*/
|
|
269
|
-
this.detectTimer = setTimeout(() => {
|
|
270
|
-
this.detect().then(() => {
|
|
271
|
-
if (this.disposed) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
this.detectTimer = undefined;
|
|
275
|
-
this.run();
|
|
276
|
-
}, () => {
|
|
277
|
-
(0, utils_1.UNREACHABLE)();
|
|
278
|
-
});
|
|
279
|
-
}, this.options.detectInterval).unref();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
exports.Health = Health;
|
|
283
|
-
//# sourceMappingURL=health.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/consumer/health.ts"],"names":[],"mappings":";;;AACA,0CAA8E;AAE9E,0CAA8E;AAC9E,wCAA2I;AAE3I,oCAA2D;AAE3D,MAAM,eAAe,GAAG;IACtB;;;;OAIG;IACH,cAAc,EAAE,EAAE,GAAG,gBAAQ;IAE7B;;;;OAIG;IACH,aAAa,EAAE,CAAC,GAAG,gBAAQ;IA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AAU,CAAC,GAAG,EAAE;YACjC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACtB,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,OAAO;iBACR;gBAED,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;gBAC7B,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,CAAC,EAAE,GAAG,EAAE;gBACN,IAAA,mBAAW,GAAE,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1C,CAAC;CAEF;AA5SD,wBA4SC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { GlobalOptions } from "../global";
|
|
2
|
-
import { Instance } from "../instance";
|
|
3
|
-
import { Logger, LoggerOptions } from "../logging";
|
|
4
|
-
import { Metadata } from "../metadata";
|
|
5
|
-
import { PluginList, PluginType, RegistryCategory, ServiceRules } from "../plugins";
|
|
6
|
-
import { LocalRegistryOptions } from "../registry";
|
|
7
|
-
import { Service } from "../service";
|
|
8
|
-
import { SkeletonClass } from "../skeleton";
|
|
9
|
-
import { PartialKeys, RequireKeys } from "../utils";
|
|
10
|
-
import { HealthOptions } from "./health";
|
|
11
|
-
import { Monitor, MonitorOptions } from "./monitor";
|
|
12
|
-
import { CallArgsType, CombinatedArgs, SelectorOptions } from "./selector";
|
|
13
|
-
export { CallArgsType } from "./selector";
|
|
14
|
-
export { ComputedStat, ComputeStatKey, StatProp } from "./monitor";
|
|
15
|
-
export { StatusChangelog, StatusChangeRequest } from "./health";
|
|
16
|
-
declare const kSelector: unique symbol;
|
|
17
|
-
declare const kMonitor: unique symbol;
|
|
18
|
-
declare const kHealth: unique symbol;
|
|
19
|
-
declare const kRegistry: unique symbol;
|
|
20
|
-
export declare class SelectResponse {
|
|
21
|
-
readonly callee: Service;
|
|
22
|
-
readonly instance: Instance;
|
|
23
|
-
private readonly [kMonitor];
|
|
24
|
-
constructor(callee: Service, instance: Instance, monitor: Monitor);
|
|
25
|
-
/**
|
|
26
|
-
* 上报调用结果
|
|
27
|
-
* @param success 是否调用成功
|
|
28
|
-
* @param cost 调用耗时(需大于等于 0,默认为 0)
|
|
29
|
-
* @param code 返回码(可选)
|
|
30
|
-
*/
|
|
31
|
-
update(success: boolean, cost?: number, code?: string): void;
|
|
32
|
-
}
|
|
33
|
-
export declare type ConsumerOptions = GlobalOptions & MonitorOptions & HealthOptions & SelectorOptions & LoggerOptions & LocalRegistryOptions;
|
|
34
|
-
declare type ConsumerPluginList = PartialKeys<Omit<PluginList, PluginType.RatelimitService | PluginType.TrafficShaping>, PluginType.CircuitBreaker>;
|
|
35
|
-
export declare type OptionalConsumerPluginList = RequireKeys<Partial<ConsumerPluginList>, PluginType.NamingService>;
|
|
36
|
-
/**
|
|
37
|
-
* For internal use only.
|
|
38
|
-
* Use `Consumer` instead of `InternalConsumer`.
|
|
39
|
-
*/
|
|
40
|
-
export declare class InternalConsumer extends SkeletonClass<ConsumerPluginList> {
|
|
41
|
-
private static mergePluginList;
|
|
42
|
-
private readonly [kSelector];
|
|
43
|
-
private readonly [kMonitor];
|
|
44
|
-
private readonly [kHealth];
|
|
45
|
-
private readonly [kRegistry];
|
|
46
|
-
/**
|
|
47
|
-
* Create Consumer
|
|
48
|
-
* @param plugins 插件
|
|
49
|
-
* @param options 配置参数(可选)
|
|
50
|
-
* @param logger Logger 对象共享,如不传则会自动创建
|
|
51
|
-
*/
|
|
52
|
-
constructor(plugins: OptionalConsumerPluginList, options?: Partial<ConsumerOptions>, logger?: Logger);
|
|
53
|
-
/**
|
|
54
|
-
* 销毁(释放)所占资源
|
|
55
|
-
*
|
|
56
|
-
* @description
|
|
57
|
-
* dispose order:
|
|
58
|
-
* Monitor -> Health -> Selector -> Registry -> [plguins]
|
|
59
|
-
*
|
|
60
|
-
* @param sync 是否同步释放(可选)
|
|
61
|
-
*/
|
|
62
|
-
dispose(sync?: boolean): void;
|
|
63
|
-
/**
|
|
64
|
-
* 获取单个服务实例
|
|
65
|
-
* @param namespace 被调方名字空间
|
|
66
|
-
* @param service 被调方服务名
|
|
67
|
-
* @param metadata 主调方服务元数据(可选)
|
|
68
|
-
* @param args 本次调用附加参数(可选)
|
|
69
|
-
*/
|
|
70
|
-
select<ServiceRouterArgs extends CombinatedArgs, LoadBalancerArgs = unknown>(namespace: string, service: string, metadata?: Metadata, args?: CallArgsType<ServiceRouterArgs, LoadBalancerArgs>): Promise<SelectResponse | null>;
|
|
71
|
-
/**
|
|
72
|
-
* 获取单个服务实例
|
|
73
|
-
* @param callee 被调方服务信息
|
|
74
|
-
* @param caller 主调方服务信息(可选)
|
|
75
|
-
* @param args 本次调用附加参数(可选)
|
|
76
|
-
*/
|
|
77
|
-
select<ServiceRouterArgs extends CombinatedArgs, LoadBalancerArgs = unknown>(callee: Service, caller?: Service, args?: CallArgsType<ServiceRouterArgs, LoadBalancerArgs>): Promise<SelectResponse | null>;
|
|
78
|
-
/**
|
|
79
|
-
* 获取全部服务实例
|
|
80
|
-
* @param namespace 服务名字空间
|
|
81
|
-
* @param service 服务名
|
|
82
|
-
*/
|
|
83
|
-
list(namespace: string, service: string): Promise<Instance[]>;
|
|
84
|
-
/**
|
|
85
|
-
* 获取服务规则路由
|
|
86
|
-
* @param namespace 服务名字空间
|
|
87
|
-
* @param service 服务名
|
|
88
|
-
*/
|
|
89
|
-
rules(namespace: string, service: string): Promise<ServiceRules>;
|
|
90
|
-
/**
|
|
91
|
-
* 强制刷新缓存
|
|
92
|
-
* @param namespace 服务名字空间
|
|
93
|
-
* @param service 服务名
|
|
94
|
-
* @param type 数据存储类别
|
|
95
|
-
*/
|
|
96
|
-
update(namespace: string, service: string, type: RegistryCategory): Promise<boolean>;
|
|
97
|
-
}
|
|
98
|
-
export declare class Consumer extends InternalConsumer {
|
|
99
|
-
#private;
|
|
100
|
-
/**
|
|
101
|
-
* 当前可实例化的最大次数
|
|
102
|
-
*/
|
|
103
|
-
static get maxInstances(): number;
|
|
104
|
-
/**
|
|
105
|
-
* 设置可实例化的最大次数
|
|
106
|
-
* @param n 最大次数
|
|
107
|
-
*/
|
|
108
|
-
static setMaxInstances(n: number): void;
|
|
109
|
-
/**
|
|
110
|
-
* Create Consumer
|
|
111
|
-
* @param plugins 插件
|
|
112
|
-
* @param options 配置参数(可选)
|
|
113
|
-
*/
|
|
114
|
-
constructor(plugins: OptionalConsumerPluginList, options?: Partial<ConsumerOptions>);
|
|
115
|
-
/**
|
|
116
|
-
* 销毁(释放)所占资源
|
|
117
|
-
* @param sync 是否同步释放(可选)
|
|
118
|
-
*/
|
|
119
|
-
dispose(sync?: boolean): void;
|
|
120
|
-
}
|