@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.
- package/package.json +1 -1
- package/resource/doc/chatuikit/faq/common/server_error_code.md +74 -0
- package/resource/doc/chatuikit/faq/{freq_qa.md → native_sdk/faq.md} +2 -1
- package/resource/doc/chatuikit/faq/web_sdk/error_code.md +47 -0
- package/resource/doc/chatuikit/faq/web_sdk/faq.md +115 -0
- package/resource/doc/chatuikit/flutter/faq.md +117 -0
- package/resource/doc/chatuikit/iOS/faq.md +117 -0
- package/resource/doc/chatuikit/react/faq.md +26 -0
- package/resource/doc/chatuikit/vue/faq.md +35 -0
- package/resource/doc/livekit/faq/common/error_code.md +89 -0
- package/resource/doc/roomkit/common/error_code.md +67 -0
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/tuicallkit/android/faq.md +1000 -0
- package/resource/doc/tuicallkit/faq/common/error_code.md +47 -0
- package/resource/doc/tuicallkit/flutter/faq.md +981 -0
- package/resource/doc/tuicallkit/{faq → iOS}/faq.md +0 -72
- package/resource/doc/tuicallkit/react/faq.md +986 -0
- package/resource/doc/tuicallkit/vue/faq.md +986 -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 -8
- 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 -12
- package/tools/common/record-prompt.js.map +1 -1
- package/tools/common/record-result.js +7 -11
- 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 +34 -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 +21 -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 +24 -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 +7 -9
- 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/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/web_qa.md +0 -118
- 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/resource/doc/chatuikit/{faq/sdk_qa.md → android/faq.md} +0 -0
- /package/{libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts → resource/doc/livekit/vue/faq.md} +0 -0
- /package/resource/doc/{chatuikit/faq/vue_qa.md → roomkit/vue/faq.md} +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Limiter = exports.Provider = exports.Consumer = exports.PolarisServerClient = exports.PolarisGRPCClient = exports.PolarisHTTPClient = exports.getEmbeddedDiscoverHosts = void 0;
|
|
18
|
-
const polaris_1 = require("./polaris");
|
|
19
|
-
__exportStar(require("./polaris"), exports);
|
|
20
|
-
// #region Embedded Host
|
|
21
|
-
var DiscoverBackend;
|
|
22
|
-
(function (DiscoverBackend) {
|
|
23
|
-
/** 正式环境 */
|
|
24
|
-
DiscoverBackend[DiscoverBackend["Formal"] = 0] = "Formal";
|
|
25
|
-
/** 测试环境 */
|
|
26
|
-
DiscoverBackend[DiscoverBackend["Debug"] = 1] = "Debug";
|
|
27
|
-
})(DiscoverBackend || (DiscoverBackend = {}));
|
|
28
|
-
const kDiscoverHosts = {
|
|
29
|
-
[DiscoverBackend.Debug]: [
|
|
30
|
-
"9.205.2.29",
|
|
31
|
-
"9.205.2.123"
|
|
32
|
-
],
|
|
33
|
-
[DiscoverBackend.Formal]: [
|
|
34
|
-
"9.141.66.244",
|
|
35
|
-
"9.146.202.27",
|
|
36
|
-
"9.146.200.81",
|
|
37
|
-
"9.146.202.35",
|
|
38
|
-
"9.146.205.191",
|
|
39
|
-
"9.146.200.61",
|
|
40
|
-
"9.141.66.219",
|
|
41
|
-
"9.141.65.110",
|
|
42
|
-
"9.141.65.29",
|
|
43
|
-
"9.141.121.7"
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
const getEmbeddedDiscoverHosts = (port) => {
|
|
47
|
-
const hosts = kDiscoverHosts[process.env.POLARIS_NAMING_DISCOVER_DEBUG ? DiscoverBackend.Debug : DiscoverBackend.Formal];
|
|
48
|
-
return port ? hosts.map(host => `${host}:${port}`) : hosts;
|
|
49
|
-
};
|
|
50
|
-
exports.getEmbeddedDiscoverHosts = getEmbeddedDiscoverHosts;
|
|
51
|
-
// #endregion
|
|
52
|
-
// #region AOP
|
|
53
|
-
// #region plugins.naming.PolarisServerClient
|
|
54
|
-
class PolarisHTTPClient extends polaris_1.PolarisHTTPClient {
|
|
55
|
-
constructor(remotes = (0, exports.getEmbeddedDiscoverHosts)(polaris_1.PolarisHTTPClient.port), options) {
|
|
56
|
-
super(remotes, options);
|
|
57
|
-
}
|
|
58
|
-
// #region Mock monitor
|
|
59
|
-
/**
|
|
60
|
-
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
61
|
-
* @returns always `false`
|
|
62
|
-
*/
|
|
63
|
-
async serviceStatistics() {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
68
|
-
* @returns always `false`
|
|
69
|
-
*/
|
|
70
|
-
async registryCache() {
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
75
|
-
* @returns always `false`
|
|
76
|
-
*/
|
|
77
|
-
async apiStatistics() {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
82
|
-
* @returns always `false`
|
|
83
|
-
*/
|
|
84
|
-
async systemConfig() {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
89
|
-
* @returns always `false`
|
|
90
|
-
*/
|
|
91
|
-
async statusChangelog() {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.PolarisHTTPClient = PolarisHTTPClient;
|
|
96
|
-
class PolarisGRPCClient extends polaris_1.PolarisGRPCClient {
|
|
97
|
-
constructor(remotes = (0, exports.getEmbeddedDiscoverHosts)(polaris_1.PolarisGRPCClient.port), options) {
|
|
98
|
-
super(remotes, options);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.PolarisGRPCClient = PolarisGRPCClient;
|
|
102
|
-
exports.PolarisServerClient = [PolarisGRPCClient].find(client => client.isSupported()) || PolarisHTTPClient;
|
|
103
|
-
// #endregion
|
|
104
|
-
// #region API
|
|
105
|
-
const { NamingService: NamingServiceType } = polaris_1.plugins.PluginType;
|
|
106
|
-
class Consumer extends polaris_1.Consumer {
|
|
107
|
-
/**
|
|
108
|
-
* Create Consumer
|
|
109
|
-
* @param plugins 插件(可选)
|
|
110
|
-
* @param options 配置参数(可选)
|
|
111
|
-
*/
|
|
112
|
-
constructor(plugins = {}, options = {}) {
|
|
113
|
-
super(plugins[NamingServiceType]
|
|
114
|
-
? plugins : Object.assign(Object.assign({}, plugins), { [NamingServiceType]: new exports.PolarisServerClient() }), options);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.Consumer = Consumer;
|
|
118
|
-
class Provider extends polaris_1.Provider {
|
|
119
|
-
/**
|
|
120
|
-
* Create Provider
|
|
121
|
-
* @param plugins 插件(可选)
|
|
122
|
-
* @param options 配置参数(可选)
|
|
123
|
-
*/
|
|
124
|
-
constructor(plugins = {}, options = {}) {
|
|
125
|
-
super(plugins[NamingServiceType]
|
|
126
|
-
? plugins : Object.assign(Object.assign({}, plugins), { [NamingServiceType]: new exports.PolarisServerClient() }), options);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
exports.Provider = Provider;
|
|
130
|
-
class Limiter extends polaris_1.Limiter {
|
|
131
|
-
/**
|
|
132
|
-
* Create Limiter
|
|
133
|
-
* @param plugins 插件(可选)
|
|
134
|
-
* @param options 配置参数(可选)
|
|
135
|
-
*/
|
|
136
|
-
constructor(plugins = {}, options = {}) {
|
|
137
|
-
super(plugins[NamingServiceType]
|
|
138
|
-
? plugins : Object.assign(Object.assign({}, plugins), { [NamingServiceType]: new exports.PolarisServerClient() }), options);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.Limiter = Limiter;
|
|
142
|
-
// #endregion
|
|
143
|
-
// #endregion
|
|
144
|
-
// #endregion
|
|
145
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAOmB;AAEnB,4CAA0B;AAE1B,wBAAwB;AACxB,IAAK,eAKJ;AALD,WAAK,eAAe;IAClB,WAAW;IACX,yDAAM,CAAA;IACN,WAAW;IACX,uDAAK,CAAA;AACP,CAAC,EALI,eAAe,KAAf,eAAe,QAKnB;AAED,MAAM,cAAc,GAAG;IACrB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE;QACvB,YAAY;QACZ,aAAa;KACd;IACD,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE;QACxB,cAAc;QACd,cAAc;QACd,cAAc;QACd,cAAc;QACd,eAAe;QACf,cAAc;QACd,cAAc;QACd,cAAc;QACd,aAAa;QACb,aAAa;KACd;CACF,CAAC;AAEK,MAAM,wBAAwB,GAAG,CAAC,IAAa,EAAE,EAAE;IACxD,MAAM,KAAK,GAAG,cAAc,CAC1B,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9F,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAA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O,CAAC,iBAAiB,CAAC;YACxB,CAAC,CAAC,OAAqC,CAAC,CAAC,iCACpC,OAAO,KACV,CAAC,iBAAiB,CAAC,EAAE,IAAI,2BAAmB,EAAE,GAC/C,EAAE,OAAO,CACb,CAAC;IACJ,CAAC;CACF;AAfD,4BAeC;AAKD,MAAa,QAAS,SAAQ,kBAAmB;IAC/C;;;;OAIG;IACH,YAAY,UAAuC,EAAE,EAAE,UAAoC,EAAE;QAC3F,KAAK,CACH,OAAO,CAAC,iBAAiB,CAAC;YACxB,CAAC,CAAC,OAAqC,CAAC,CAAC,iCACpC,OAAO,KACV,CAAC,iBAAiB,CAAC,EAAE,IAAI,2BAAmB,EAAE,GAC/C,EAAE,OAAO,CACb,CAAC;IACJ,CAAC;CACF;AAfD,4BAeC;AAKD,MAAa,OAAQ,SAAQ,iBAAkB;IAC7C;;;;OAIG;IACH,YAAY,UAAsC,EAAE,EAAE,UAAmC,EAAE;QACzF,KAAK,CACH,OAAO,CAAC,iBAAiB,CAAC;YACxB,CAAC,CAAC,OAAoC,CAAC,CAAC,iCACnC,OAAO,KACV,CAAC,iBAAiB,CAAC,EAAE,IAAI,2BAAmB,EAAE,GAC/C,EAAE,OAAO,CACb,CAAC;IACJ,CAAC;CACF;AAfD,0BAeC;AACD,aAAa;AAEb,aAAa;AACb,aAAa"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Location } from "./location";
|
|
2
|
-
import { Metadata } from "./metadata";
|
|
3
|
-
/**
|
|
4
|
-
* 实例状态
|
|
5
|
-
*
|
|
6
|
-
* ```
|
|
7
|
-
* STD:
|
|
8
|
-
* +---------------------------------------(`CircuitBreaker`)-----------------------------------------------+
|
|
9
|
-
* | |
|
|
10
|
-
* v +
|
|
11
|
-
* Fused +---(`OutlierDetector`)---> HalfOpen +---(`LoadBalancer`)---> HalfClose +---(`CircuitBreaker`)---> Normal
|
|
12
|
-
* ^ +
|
|
13
|
-
* | |
|
|
14
|
-
* +------------------------(`CircuitBreaker`)---------------------------+
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const enum InstanceStatus {
|
|
18
|
-
/**
|
|
19
|
-
* 正常
|
|
20
|
-
*/
|
|
21
|
-
Normal = 0,
|
|
22
|
-
/**
|
|
23
|
-
* 半打开
|
|
24
|
-
*
|
|
25
|
-
* 各周期只选出极少次,负责探活
|
|
26
|
-
*/
|
|
27
|
-
HalfOpen = 1,
|
|
28
|
-
/**
|
|
29
|
-
* 半关闭
|
|
30
|
-
*
|
|
31
|
-
* 不在任何模块中被选出,但计算调用结果
|
|
32
|
-
*/
|
|
33
|
-
HalfClose = 2,
|
|
34
|
-
/**
|
|
35
|
-
* 熔断
|
|
36
|
-
*
|
|
37
|
-
* 不在任何模块中被选出
|
|
38
|
-
*/
|
|
39
|
-
Fused = 3
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* 实例
|
|
43
|
-
*/
|
|
44
|
-
export interface Instance {
|
|
45
|
-
/**
|
|
46
|
-
* 唯一 ID
|
|
47
|
-
*/
|
|
48
|
-
readonly id: string;
|
|
49
|
-
/**
|
|
50
|
-
* vpc_id
|
|
51
|
-
*/
|
|
52
|
-
vpcId: string;
|
|
53
|
-
/**
|
|
54
|
-
* IP 或 域名
|
|
55
|
-
*/
|
|
56
|
-
host: string;
|
|
57
|
-
/**
|
|
58
|
-
* 端口号
|
|
59
|
-
*/
|
|
60
|
-
port: number;
|
|
61
|
-
/**
|
|
62
|
-
* 协议信息
|
|
63
|
-
*/
|
|
64
|
-
protocol: string;
|
|
65
|
-
/**
|
|
66
|
-
* 静态权重值, 0-1000
|
|
67
|
-
*/
|
|
68
|
-
staticWeight: number;
|
|
69
|
-
/**
|
|
70
|
-
* 动态权重值
|
|
71
|
-
*/
|
|
72
|
-
dynamicWeight: number;
|
|
73
|
-
/**
|
|
74
|
-
* 当前状态
|
|
75
|
-
*/
|
|
76
|
-
status: InstanceStatus;
|
|
77
|
-
/**
|
|
78
|
-
* 元数据信息
|
|
79
|
-
*/
|
|
80
|
-
metadata: Metadata;
|
|
81
|
-
/**
|
|
82
|
-
* 优先级
|
|
83
|
-
*/
|
|
84
|
-
priority: number;
|
|
85
|
-
/**
|
|
86
|
-
* 版本号
|
|
87
|
-
*/
|
|
88
|
-
version: string;
|
|
89
|
-
/**
|
|
90
|
-
* 逻辑区域
|
|
91
|
-
*/
|
|
92
|
-
logicSet: string;
|
|
93
|
-
/**
|
|
94
|
-
* 地理位置
|
|
95
|
-
*/
|
|
96
|
-
location: Location;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* 实例静态拷贝
|
|
100
|
-
* @param from 源实例
|
|
101
|
-
* @param to 目标实例
|
|
102
|
-
*/
|
|
103
|
-
export declare const instanceCopy: (from: Instance, to: Instance) => void;
|
|
104
|
-
/**
|
|
105
|
-
* 判断实例是否可被选取
|
|
106
|
-
* @param instance 实例
|
|
107
|
-
* @returns 是否可选取
|
|
108
|
-
*/
|
|
109
|
-
export declare const isChoosableInstance: (instance: Instance) => boolean;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isChoosableInstance = exports.instanceCopy = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* 所需拷贝的静态属性值
|
|
6
|
-
* note:这里不拷贝 `status` 与 `dynamicWeight`,以 `id` 进行关联
|
|
7
|
-
*/
|
|
8
|
-
const kStaticProps = [
|
|
9
|
-
"vpcId",
|
|
10
|
-
"host",
|
|
11
|
-
"port",
|
|
12
|
-
"metadata",
|
|
13
|
-
"protocol",
|
|
14
|
-
"staticWeight",
|
|
15
|
-
"priority",
|
|
16
|
-
"version",
|
|
17
|
-
"logicSet",
|
|
18
|
-
"location"
|
|
19
|
-
];
|
|
20
|
-
/**
|
|
21
|
-
* 实例静态拷贝
|
|
22
|
-
* @param from 源实例
|
|
23
|
-
* @param to 目标实例
|
|
24
|
-
*/
|
|
25
|
-
const instanceCopy = (from, to) => {
|
|
26
|
-
kStaticProps.forEach((key) => {
|
|
27
|
-
to[key] = from[key];
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
exports.instanceCopy = instanceCopy;
|
|
31
|
-
/**
|
|
32
|
-
* 判断实例是否可被选取
|
|
33
|
-
* @param instance 实例
|
|
34
|
-
* @returns 是否可选取
|
|
35
|
-
*/
|
|
36
|
-
const isChoosableInstance = (instance) => (instance.status === 1 /* HalfOpen */ || instance.status === 0 /* Normal */);
|
|
37
|
-
exports.isChoosableInstance = isChoosableInstance;
|
|
38
|
-
//# sourceMappingURL=instance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sourceRoot":"","sources":["../src/instance.ts"],"names":[],"mappings":";;;AAmHA;;;GAGG;AACH,MAAM,YAAY,GAAoC;IACpD,OAAO;IACP,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,cAAc;IACd,UAAU;IACV,SAAS;IACT,UAAU;IACV,UAAU;CACX,CAAC;AACF;;;;GAIG;AACI,MAAM,YAAY,GAAG,CAAC,IAAc,EAAE,EAAY,EAAQ,EAAE;IACjE,YAAY,CAAC,OAAO,CAAC,CAA2B,GAAM,EAAE,EAAE;QACxD,EAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,YAAY,gBAIvB;AAEF;;;;GAIG;AACI,MAAM,mBAAmB,GAAG,CAAC,QAAkB,EAAW,EAAE,CAAC,CAClE,QAAQ,CAAC,MAAM,qBAA4B,IAAI,QAAQ,CAAC,MAAM,mBAA0B,CACzF,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export interface InternalBucketOptions {
|
|
2
|
-
/**
|
|
3
|
-
* 令牌桶空闲回收,判定周期数
|
|
4
|
-
*/
|
|
5
|
-
idlePeriod: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* 基础令牌桶
|
|
9
|
-
* 桶内剩余可用令牌,不会增加
|
|
10
|
-
*/
|
|
11
|
-
export declare class BasicBucket {
|
|
12
|
-
protected total: number;
|
|
13
|
-
protected partition: number;
|
|
14
|
-
private overflow;
|
|
15
|
-
protected remains: number;
|
|
16
|
-
protected capacity: number;
|
|
17
|
-
constructor(total: number, partition: number, overflow?: boolean);
|
|
18
|
-
get partitionTokens(): number;
|
|
19
|
-
get remainingTokens(): number;
|
|
20
|
-
setPartition(partition: number): void;
|
|
21
|
-
consume(tokens: number, preroll: boolean): boolean;
|
|
22
|
-
drain(): number;
|
|
23
|
-
private recalculate;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* 内部令牌桶
|
|
27
|
-
* 桶内剩余可用令牌,由内部新增
|
|
28
|
-
*/
|
|
29
|
-
export declare class InternalBucket extends BasicBucket {
|
|
30
|
-
private duration;
|
|
31
|
-
private options;
|
|
32
|
-
private isAccessed;
|
|
33
|
-
private idlePeriods;
|
|
34
|
-
private period;
|
|
35
|
-
private timer;
|
|
36
|
-
private sleepTime?;
|
|
37
|
-
constructor(total: number, partition: number, overflow: boolean | undefined, duration: number, options: InternalBucketOptions);
|
|
38
|
-
get currentPeriod(): number;
|
|
39
|
-
consume(tokens: number, preroll: boolean): boolean;
|
|
40
|
-
private onWakUp;
|
|
41
|
-
private wake;
|
|
42
|
-
private sleep;
|
|
43
|
-
private onTimeout;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* 外部令牌桶
|
|
47
|
-
* 桶内剩余可用令牌,由外部调整
|
|
48
|
-
*/
|
|
49
|
-
export declare class ExternalBucket extends BasicBucket {
|
|
50
|
-
update(value: number): void;
|
|
51
|
-
}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExternalBucket = exports.InternalBucket = exports.BasicBucket = void 0;
|
|
4
|
-
const process_1 = require("process");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
/**
|
|
7
|
-
* 基础令牌桶
|
|
8
|
-
* 桶内剩余可用令牌,不会增加
|
|
9
|
-
*/
|
|
10
|
-
class BasicBucket {
|
|
11
|
-
constructor(total, partition, overflow = false) {
|
|
12
|
-
this.total = total;
|
|
13
|
-
this.partition = partition;
|
|
14
|
-
this.overflow = overflow;
|
|
15
|
-
this.capacity = ~~(this.total / this.partition);
|
|
16
|
-
this.remains = this.capacity;
|
|
17
|
-
}
|
|
18
|
-
get partitionTokens() {
|
|
19
|
-
return this.capacity;
|
|
20
|
-
}
|
|
21
|
-
get remainingTokens() {
|
|
22
|
-
return this.remains;
|
|
23
|
-
}
|
|
24
|
-
setPartition(partition) {
|
|
25
|
-
this.recalculate(partition);
|
|
26
|
-
this.partition = partition;
|
|
27
|
-
this.capacity = ~~(this.total / this.partition);
|
|
28
|
-
}
|
|
29
|
-
consume(tokens, preroll) {
|
|
30
|
-
if (!(this.remains >= tokens)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (!preroll) {
|
|
34
|
-
this.remains -= tokens;
|
|
35
|
-
/*
|
|
36
|
-
* note:
|
|
37
|
-
* 由于 `tokens` 可能为负值,
|
|
38
|
-
* 导致计算出的 `remains` 超过总值 `capacity`
|
|
39
|
-
*/
|
|
40
|
-
if (!this.overflow && this.remains > this.capacity) {
|
|
41
|
-
this.remains = this.capacity;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
drain() {
|
|
47
|
-
const { remains } = this;
|
|
48
|
-
this.remains = 0;
|
|
49
|
-
return remains;
|
|
50
|
-
}
|
|
51
|
-
recalculate(partition) {
|
|
52
|
-
let remains = ~~(this.total / partition) - (this.capacity - this.remains);
|
|
53
|
-
if (remains < 0) {
|
|
54
|
-
remains = 0;
|
|
55
|
-
}
|
|
56
|
-
this.remains = remains;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.BasicBucket = BasicBucket;
|
|
60
|
-
/**
|
|
61
|
-
* 内部令牌桶
|
|
62
|
-
* 桶内剩余可用令牌,由内部新增
|
|
63
|
-
*/
|
|
64
|
-
class InternalBucket extends BasicBucket {
|
|
65
|
-
constructor(total, partition, overflow = false, duration, options) {
|
|
66
|
-
super(total, partition, overflow);
|
|
67
|
-
this.duration = duration;
|
|
68
|
-
this.options = options;
|
|
69
|
-
this.isAccessed = false;
|
|
70
|
-
this.idlePeriods = 0;
|
|
71
|
-
this.period = 0;
|
|
72
|
-
this.onWakUp(false);
|
|
73
|
-
}
|
|
74
|
-
get currentPeriod() {
|
|
75
|
-
return this.period;
|
|
76
|
-
}
|
|
77
|
-
consume(tokens, preroll) {
|
|
78
|
-
this.isAccessed = true;
|
|
79
|
-
this.wake();
|
|
80
|
-
return super.consume(tokens, preroll);
|
|
81
|
-
}
|
|
82
|
-
// #region Wake-sleep
|
|
83
|
-
onWakUp(immediate) {
|
|
84
|
-
if (immediate) {
|
|
85
|
-
this.onTimeout();
|
|
86
|
-
}
|
|
87
|
-
this.timer = setInterval(() => this.onTimeout.bind(this), this.duration).unref();
|
|
88
|
-
}
|
|
89
|
-
wake() {
|
|
90
|
-
if (this.timer === undefined) {
|
|
91
|
-
if (this.sleepTime === undefined) {
|
|
92
|
-
(0, utils_1.UNREACHABLE)();
|
|
93
|
-
}
|
|
94
|
-
const elapsedTime = Math.floor(((0, process_1.uptime)() - this.sleepTime) * utils_1.kSeconds);
|
|
95
|
-
this.period += Math.floor(elapsedTime / this.duration);
|
|
96
|
-
const interval = elapsedTime % this.duration;
|
|
97
|
-
if (interval === 0) {
|
|
98
|
-
this.onWakUp(false);
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
this.timer = setTimeout(this.onWakUp.bind(this, true), interval).unref();
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
sleep() {
|
|
106
|
-
if (this.timer !== undefined) {
|
|
107
|
-
clearInterval(this.timer);
|
|
108
|
-
this.timer = undefined;
|
|
109
|
-
}
|
|
110
|
-
this.sleepTime = (0, process_1.uptime)();
|
|
111
|
-
this.idlePeriods = 0;
|
|
112
|
-
this.isAccessed = false;
|
|
113
|
-
}
|
|
114
|
-
// #endregion
|
|
115
|
-
onTimeout() {
|
|
116
|
-
this.period += 1;
|
|
117
|
-
this.remains = this.capacity;
|
|
118
|
-
if (this.isAccessed) {
|
|
119
|
-
this.idlePeriods = 0;
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
this.idlePeriods += 1;
|
|
123
|
-
}
|
|
124
|
-
this.isAccessed = false;
|
|
125
|
-
/*
|
|
126
|
-
* 为了降低消耗,当超过 `this.options.idlePeriod` 周期没有访问时,
|
|
127
|
-
* 自动进入休眠状态(停止一切定时器)
|
|
128
|
-
*
|
|
129
|
-
* note:
|
|
130
|
-
* 如外部不再强引用(WeakMap 为弱引用)当前对象,当进入休眠状态后,当前对象会被自动回收
|
|
131
|
-
*/
|
|
132
|
-
if (this.idlePeriods > this.options.idlePeriod) {
|
|
133
|
-
this.sleep();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.InternalBucket = InternalBucket;
|
|
138
|
-
/**
|
|
139
|
-
* 外部令牌桶
|
|
140
|
-
* 桶内剩余可用令牌,由外部调整
|
|
141
|
-
*/
|
|
142
|
-
class ExternalBucket extends BasicBucket {
|
|
143
|
-
update(value) {
|
|
144
|
-
let remains = ~~((this.total - value) / this.partition);
|
|
145
|
-
if (remains < 0) {
|
|
146
|
-
remains = 0;
|
|
147
|
-
}
|
|
148
|
-
this.remains = remains;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
exports.ExternalBucket = ExternalBucket;
|
|
152
|
-
//# sourceMappingURL=bucket.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bucket.js","sourceR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OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE7B,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;SACtB;aAAM;YACL,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;SACvB;QACD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAExB;;;;;;WAMG;QACH,IAAI,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;SACd;IACH,CAAC;CACF;AApFD,wCAoFC;AAED;;;GAGG;AACH,MAAa,cAAe,SAAQ,WAAW;IAC7C,MAAM,CAAC,KAAa;QAClB,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;QACxD,IAAI,OAAO,GAAG,CAAC,EAAE;YACf,OAAO,GAAG,CAAC,CAAC;SACb;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AARD,wCAQC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { GlobalOptions } from "../global";
|
|
2
|
-
import { LoggerOptions } from "../logging";
|
|
3
|
-
import { Metadata } from "../metadata";
|
|
4
|
-
import { PluginList, PluginType } from "../plugins";
|
|
5
|
-
import { LocalRegistryOptions } from "../registry";
|
|
6
|
-
import { SkeletonClass } from "../skeleton";
|
|
7
|
-
import { RequireKeys } from "../utils";
|
|
8
|
-
import { Quota, RatelimitOptions } from "./ratelimit";
|
|
9
|
-
declare type LimiterPluginList = Pick<PluginList, PluginType.LocalRegistry | PluginType.NamingService | PluginType.RatelimitService | PluginType.TrafficShaping | PluginType.TraceLogging | PluginType.StatReporter>;
|
|
10
|
-
export declare type OptionalLimiterPluginList = RequireKeys<Partial<LimiterPluginList>, PluginType.NamingService>;
|
|
11
|
-
export declare type LimiterOptions = GlobalOptions & RatelimitOptions & LoggerOptions & LocalRegistryOptions;
|
|
12
|
-
export interface AcquireResponse {
|
|
13
|
-
/**
|
|
14
|
-
* 唯一 ID
|
|
15
|
-
* 用于优化下次查询性能
|
|
16
|
-
*/
|
|
17
|
-
readonly id?: string;
|
|
18
|
-
/**
|
|
19
|
-
* 配额
|
|
20
|
-
*/
|
|
21
|
-
readonly quotas: Quota[];
|
|
22
|
-
}
|
|
23
|
-
declare const kRatelimit: unique symbol;
|
|
24
|
-
declare const kRegistry: unique symbol;
|
|
25
|
-
declare const kCurrentInstances: unique symbol;
|
|
26
|
-
declare const KMaxInstances: unique symbol;
|
|
27
|
-
export declare class Limiter extends SkeletonClass<LimiterPluginList> {
|
|
28
|
-
/**
|
|
29
|
-
* note:
|
|
30
|
-
* 由于类包含专用标识符时,`super` 调用必须是构造函数中的第一个语句。
|
|
31
|
-
* 所以这里采用 `Symbol` 来实现 __私有静态属性__
|
|
32
|
-
*/
|
|
33
|
-
private static [kCurrentInstances];
|
|
34
|
-
private static [KMaxInstances];
|
|
35
|
-
/**
|
|
36
|
-
* 当前可实例化的最大次数
|
|
37
|
-
*/
|
|
38
|
-
static get maxInstances(): number;
|
|
39
|
-
/**
|
|
40
|
-
* 设置可实例化的最大次数
|
|
41
|
-
* @param n 最大次数
|
|
42
|
-
*/
|
|
43
|
-
static setMaxInstances(n: number): void;
|
|
44
|
-
private readonly [kRatelimit];
|
|
45
|
-
private readonly [kRegistry];
|
|
46
|
-
/**
|
|
47
|
-
* Create Limiter
|
|
48
|
-
* @param plugins 插件
|
|
49
|
-
* @param options 配置参数(可选)
|
|
50
|
-
*/
|
|
51
|
-
constructor(plugins: OptionalLimiterPluginList, options?: Partial<LimiterOptions>);
|
|
52
|
-
/**
|
|
53
|
-
* 销毁(释放)所占资源
|
|
54
|
-
*
|
|
55
|
-
* @description
|
|
56
|
-
* dispose order:
|
|
57
|
-
* Ratelimit -> Registry -> [plguins]
|
|
58
|
-
*
|
|
59
|
-
* @param sync 是否同步释放(可选)
|
|
60
|
-
*/
|
|
61
|
-
dispose(sync?: boolean): void;
|
|
62
|
-
/**
|
|
63
|
-
* 通过条件获取配额分配对象
|
|
64
|
-
* @param namespace 命名空间
|
|
65
|
-
* @param service 服务名
|
|
66
|
-
* @param amount 请求的配额数
|
|
67
|
-
* @param cluster 集群名(可选)
|
|
68
|
-
* @param labels 标签集合(可选)
|
|
69
|
-
* @param id 唯一 ID(可选)
|
|
70
|
-
*/
|
|
71
|
-
acquire(namespace: string, service: string, amount: number, cluster?: string, labels?: Metadata, id?: string): Promise<AcquireResponse>;
|
|
72
|
-
}
|
|
73
|
-
export {};
|