@tencent-rtc/mcp 1.0.0
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/@tencent/aegis-node-sdk/CHANGELOG.md +8 -0
- package/@tencent/aegis-node-sdk/LICENSE +21 -0
- package/@tencent/aegis-node-sdk/README.md +562 -0
- package/@tencent/aegis-node-sdk/lib/aegis.min.js +1 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +14 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +1 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +9 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +2 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +85 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +3 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +9 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +3 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +9 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +62 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +11 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +4 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +130 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +34 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +2 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +18 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +8 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +8 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +2 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +4 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +10 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +3 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +3 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +34 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +12 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +14 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +2 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +12 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +3 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +33 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +2 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +18 -0
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +60 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +15 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +5 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +6 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +18 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +12 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +10 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +20 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +27 -0
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +2 -0
- package/@tencent/aegis-node-sdk/package.json +19 -0
- package/@tencent/polaris/README.md +407 -0
- package/@tencent/polaris/dist/consumer/health.d.ts +126 -0
- package/@tencent/polaris/dist/consumer/health.js +283 -0
- package/@tencent/polaris/dist/consumer/health.js.map +1 -0
- package/@tencent/polaris/dist/consumer/index.d.ts +120 -0
- package/@tencent/polaris/dist/consumer/index.js +348 -0
- package/@tencent/polaris/dist/consumer/index.js.map +1 -0
- package/@tencent/polaris/dist/consumer/monitor.d.ts +145 -0
- package/@tencent/polaris/dist/consumer/monitor.js +343 -0
- package/@tencent/polaris/dist/consumer/monitor.js.map +1 -0
- package/@tencent/polaris/dist/consumer/selector.d.ts +73 -0
- package/@tencent/polaris/dist/consumer/selector.js +316 -0
- package/@tencent/polaris/dist/consumer/selector.js.map +1 -0
- package/@tencent/polaris/dist/errors.d.ts +373 -0
- package/@tencent/polaris/dist/errors.js +154 -0
- package/@tencent/polaris/dist/errors.js.map +1 -0
- package/@tencent/polaris/dist/global.d.ts +16 -0
- package/@tencent/polaris/dist/global.js +18 -0
- package/@tencent/polaris/dist/global.js.map +1 -0
- package/@tencent/polaris/dist/index.d.ts +62 -0
- package/@tencent/polaris/dist/index.js +145 -0
- package/@tencent/polaris/dist/index.js.map +1 -0
- package/@tencent/polaris/dist/instance.d.ts +109 -0
- package/@tencent/polaris/dist/instance.js +38 -0
- package/@tencent/polaris/dist/instance.js.map +1 -0
- package/@tencent/polaris/dist/limiter/bucket.d.ts +51 -0
- package/@tencent/polaris/dist/limiter/bucket.js +152 -0
- package/@tencent/polaris/dist/limiter/bucket.js.map +1 -0
- package/@tencent/polaris/dist/limiter/index.d.ts +73 -0
- package/@tencent/polaris/dist/limiter/index.js +149 -0
- package/@tencent/polaris/dist/limiter/index.js.map +1 -0
- package/@tencent/polaris/dist/limiter/ratelimit.d.ts +27 -0
- package/@tencent/polaris/dist/limiter/ratelimit.js +134 -0
- package/@tencent/polaris/dist/limiter/ratelimit.js.map +1 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +17 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js +15 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +1 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +59 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js +397 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +1 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +3 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js +19 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +1 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +17 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js +52 -0
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +1 -0
- package/@tencent/polaris/dist/location.d.ts +48 -0
- package/@tencent/polaris/dist/location.js +67 -0
- package/@tencent/polaris/dist/location.js.map +1 -0
- package/@tencent/polaris/dist/logging.d.ts +106 -0
- package/@tencent/polaris/dist/logging.js +130 -0
- package/@tencent/polaris/dist/logging.js.map +1 -0
- package/@tencent/polaris/dist/metadata.d.ts +78 -0
- package/@tencent/polaris/dist/metadata.js +119 -0
- package/@tencent/polaris/dist/metadata.js.map +1 -0
- package/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +47 -0
- package/@tencent/polaris/dist/plugins/breaker/polaris.js +162 -0
- package/@tencent/polaris/dist/plugins/breaker/polaris.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/base.d.ts +24 -0
- package/@tencent/polaris/dist/plugins/lb/base.js +32 -0
- package/@tencent/polaris/dist/plugins/lb/base.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/edf.d.ts +24 -0
- package/@tencent/polaris/dist/plugins/lb/edf.js +77 -0
- package/@tencent/polaris/dist/plugins/lb/edf.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/hashring.d.ts +24 -0
- package/@tencent/polaris/dist/plugins/lb/hashring.js +53 -0
- package/@tencent/polaris/dist/plugins/lb/hashring.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/sticky.d.ts +31 -0
- package/@tencent/polaris/dist/plugins/lb/sticky.js +88 -0
- package/@tencent/polaris/dist/plugins/lb/sticky.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/swrr.d.ts +25 -0
- package/@tencent/polaris/dist/plugins/lb/swrr.js +72 -0
- package/@tencent/polaris/dist/plugins/lb/swrr.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/wr.d.ts +17 -0
- package/@tencent/polaris/dist/plugins/lb/wr.js +50 -0
- package/@tencent/polaris/dist/plugins/lb/wr.js.map +1 -0
- package/@tencent/polaris/dist/plugins/lb/wrr.d.ts +19 -0
- package/@tencent/polaris/dist/plugins/lb/wrr.js +81 -0
- package/@tencent/polaris/dist/plugins/lb/wrr.js.map +1 -0
- package/@tencent/polaris/dist/plugins/logging/console.d.ts +10 -0
- package/@tencent/polaris/dist/plugins/logging/console.js +38 -0
- package/@tencent/polaris/dist/plugins/logging/console.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +32 -0
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js +88 -0
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +124 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +398 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +27 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +287 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +15 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +43 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +28 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +249 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +19 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +222 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +26 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +99 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +60 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +259 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +24 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +18 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +12 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +39 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +115 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +24 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +22 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +28 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +80 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +18 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +65 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +66 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +95 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +1568 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +36 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +51 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +18 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +67 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +82 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +11 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +46 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +16 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +10 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +1102 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +29 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +77 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +12 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +28 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +395 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +13 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +116 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +67 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +67 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +1 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +99 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +217 -0
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +1 -0
- package/@tencent/polaris/dist/plugins/registry/memory.d.ts +10 -0
- package/@tencent/polaris/dist/plugins/registry/memory.js +50 -0
- package/@tencent/polaris/dist/plugins/registry/memory.js.map +1 -0
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +51 -0
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js +145 -0
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +1 -0
- package/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +11 -0
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js +174 -0
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +1 -0
- package/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +25 -0
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js +36 -0
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +1 -0
- package/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +10 -0
- package/@tencent/polaris/dist/plugins/router/trpc/env.js +34 -0
- package/@tencent/polaris/dist/plugins/router/trpc/env.js.map +1 -0
- package/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +56 -0
- package/@tencent/polaris/dist/plugins/router/trpc/set.js +106 -0
- package/@tencent/polaris/dist/plugins/router/trpc/set.js.map +1 -0
- package/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +31 -0
- package/@tencent/polaris/dist/plugins/shaping/unirate.js +124 -0
- package/@tencent/polaris/dist/plugins/shaping/unirate.js.map +1 -0
- package/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +61 -0
- package/@tencent/polaris/dist/plugins/shaping/warmup.js +171 -0
- package/@tencent/polaris/dist/plugins/shaping/warmup.js.map +1 -0
- package/@tencent/polaris/dist/plugins/weight/polaris.d.ts +23 -0
- package/@tencent/polaris/dist/plugins/weight/polaris.js +159 -0
- package/@tencent/polaris/dist/plugins/weight/polaris.js.map +1 -0
- package/@tencent/polaris/dist/plugins.d.ts +619 -0
- package/@tencent/polaris/dist/plugins.js +91 -0
- package/@tencent/polaris/dist/plugins.js.map +1 -0
- package/@tencent/polaris/dist/polaris.d.ts +33 -0
- package/@tencent/polaris/dist/polaris.js +59 -0
- package/@tencent/polaris/dist/polaris.js.map +1 -0
- package/@tencent/polaris/dist/provider/index.d.ts +102 -0
- package/@tencent/polaris/dist/provider/index.js +168 -0
- package/@tencent/polaris/dist/provider/index.js.map +1 -0
- package/@tencent/polaris/dist/registry.d.ts +174 -0
- package/@tencent/polaris/dist/registry.js +660 -0
- package/@tencent/polaris/dist/registry.js.map +1 -0
- package/@tencent/polaris/dist/rules.d.ts +163 -0
- package/@tencent/polaris/dist/rules.js +24 -0
- package/@tencent/polaris/dist/rules.js.map +1 -0
- package/@tencent/polaris/dist/scripts/postinstall.d.ts +1 -0
- package/@tencent/polaris/dist/scripts/postinstall.js +71 -0
- package/@tencent/polaris/dist/scripts/postinstall.js.map +1 -0
- package/@tencent/polaris/dist/service.d.ts +18 -0
- package/@tencent/polaris/dist/service.js +3 -0
- package/@tencent/polaris/dist/service.js.map +1 -0
- package/@tencent/polaris/dist/skeleton.d.ts +87 -0
- package/@tencent/polaris/dist/skeleton.js +282 -0
- package/@tencent/polaris/dist/skeleton.js.map +1 -0
- package/@tencent/polaris/dist/utils.d.ts +36 -0
- package/@tencent/polaris/dist/utils.js +74 -0
- package/@tencent/polaris/dist/utils.js.map +1 -0
- package/@tencent/polaris/dist/weak.d.ts +11 -0
- package/@tencent/polaris/dist/weak.js +44 -0
- package/@tencent/polaris/dist/weak.js.map +1 -0
- package/@tencent/polaris/package.json +114 -0
- package/README.md +61 -0
- package/cursor-setting.png +0 -0
- package/index.js +16 -0
- package/index.js.map +1 -0
- package/mcp-server-prompt.png +0 -0
- package/mcp.json +8 -0
- package/package.json +49 -0
- package/resource/doc/tuicallkit/android/.gitkeep +0 -0
- package/resource/doc/tuicallkit/android/api_TUICallKit.md +610 -0
- package/resource/doc/tuicallkit/android/api_TUICallObserver.md +784 -0
- package/resource/doc/tuicallkit/android/how_to_integrated_android_callkit.md +286 -0
- package/resource/doc/tuicallkit/faq/faq.md +127 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallDefine.md +938 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallKit.md +469 -0
- package/resource/doc/tuicallkit/flutter/api_TUICallObserver.md +897 -0
- package/resource/doc/tuicallkit/flutter/how_to_integrated_flutter_callkit.md +226 -0
- package/resource/doc/tuicallkit/flutter/how_to_run_flutter_callkit_demo.md +101 -0
- package/resource/doc/tuicallkit/iOS/api_TUICallKit.md +398 -0
- package/resource/doc/tuicallkit/iOS/api_TUICallObserver.md +781 -0
- package/resource/doc/tuicallkit/iOS/how_to_integrated_iOS_callkit.md +268 -0
- package/resource/doc/tuicallkit/iOS/how_to_run_iOS_callkit_demo.md +98 -0
- package/resource/doc/tuicallkit/react/.gitkeep +0 -0
- package/resource/doc/tuicallkit/react/api_TUICallKit.md +354 -0
- package/resource/doc/tuicallkit/react/how_to_integrated_react_callkit.md +166 -0
- package/resource/doc/tuicallkit/react/how_to_run_react_callkit_demo.md +61 -0
- package/resource/doc/tuicallkit/vue/.gitkeep +0 -0
- package/resource/doc/tuicallkit/vue/api_TUICallKit.md +354 -0
- package/resource/doc/tuicallkit/vue/how_to_integrated_vue_callkit.md +187 -0
- package/resource/doc/tuicallkit/vue/how_to_run_vue_callkit_demo.md +61 -0
- package/server.js +132 -0
- package/server.js.map +1 -0
- package/streamableHttp.js +74 -0
- package/streamableHttp.js.map +1 -0
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AssertionError } from "assert";
|
|
3
|
+
export declare enum ErrorCodes {
|
|
4
|
+
/** 接口参数错误 */
|
|
5
|
+
InvalidArgument = "ErrCodeAPIInvalidArgument",
|
|
6
|
+
/** 配置参数校验失败 */
|
|
7
|
+
InvalidConfig = "ErrCodeAPIInvalidConfig",
|
|
8
|
+
/** 插件调用异常 */
|
|
9
|
+
PluginError = "ErrCodePluginError",
|
|
10
|
+
/** 调用超时 */
|
|
11
|
+
TimeoutError = "ErrCodeAPITimeoutError",
|
|
12
|
+
/** 状态错误 */
|
|
13
|
+
StateError = "ErrCodeInvalidStateError",
|
|
14
|
+
/** 后端服务错误 */
|
|
15
|
+
ServerError = "ErrCodeServerError",
|
|
16
|
+
/** 网络异常 */
|
|
17
|
+
NetworkError = "ErrCodeNetworkError",
|
|
18
|
+
/** 服务熔断发生错误 */
|
|
19
|
+
CircuitBreakerError = "ErrCodeCircuitBreakerError",
|
|
20
|
+
/** 实例信息不合法 */
|
|
21
|
+
InvalidInstance = "ErrCodeInstanceInfoError",
|
|
22
|
+
/** 负载均衡、服务路由时,传入的服务没有实例信息 */
|
|
23
|
+
InstanceNotFound = "ErrCodeAPIInstanceNotFound",
|
|
24
|
+
/** 路由规则不合法 */
|
|
25
|
+
InvalidRouteRule = "ErrCodeInvalidRouteRule",
|
|
26
|
+
/** 路由规则无法匹配 */
|
|
27
|
+
RouteRuleNotMatch = "ErrCodeRouteRuleNotMatch",
|
|
28
|
+
/** 后端返回无效 */
|
|
29
|
+
InvalidResponse = "ErrCodeInvalidResponse",
|
|
30
|
+
/** 内部错误 */
|
|
31
|
+
InternalError = "ErrCodeInternalError",
|
|
32
|
+
/** 服务不存在 */
|
|
33
|
+
ServiceNotFound = "ErrCodeServiceNotFound",
|
|
34
|
+
/** 后端服务异常 */
|
|
35
|
+
ServerException = "ErrCodeServerException",
|
|
36
|
+
/** 获取位置信息失败 */
|
|
37
|
+
LocationNotFound = "ErrCodeLocationNotFound"
|
|
38
|
+
}
|
|
39
|
+
export declare const kErrorCode: unique symbol;
|
|
40
|
+
export interface PolarisError extends Error {
|
|
41
|
+
readonly [kErrorCode]: ErrorCodes;
|
|
42
|
+
}
|
|
43
|
+
export declare const isPolarisError: (err: unknown) => err is PolarisError;
|
|
44
|
+
/** Node.js internal primordials Error */
|
|
45
|
+
export declare const PrimordialsError: ErrorConstructor;
|
|
46
|
+
export declare class FatalError extends AssertionError implements PolarisError {
|
|
47
|
+
constructor(message: string, fn?: CallableFunction);
|
|
48
|
+
get [kErrorCode](): ErrorCodes;
|
|
49
|
+
}
|
|
50
|
+
declare const ArgumentError_base: {
|
|
51
|
+
new (err?: Error | undefined): {
|
|
52
|
+
[kErrorCode]: ErrorCodes;
|
|
53
|
+
name: string;
|
|
54
|
+
message: string;
|
|
55
|
+
stack?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
new (message?: string | undefined): {
|
|
58
|
+
[kErrorCode]: ErrorCodes;
|
|
59
|
+
name: string;
|
|
60
|
+
message: string;
|
|
61
|
+
stack?: string | undefined;
|
|
62
|
+
};
|
|
63
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
64
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
65
|
+
stackTraceLimit: number;
|
|
66
|
+
};
|
|
67
|
+
export declare class ArgumentError extends ArgumentError_base {
|
|
68
|
+
}
|
|
69
|
+
declare const ConfigError_base: {
|
|
70
|
+
new (err?: Error | undefined): {
|
|
71
|
+
[kErrorCode]: ErrorCodes;
|
|
72
|
+
name: string;
|
|
73
|
+
message: string;
|
|
74
|
+
stack?: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
new (message?: string | undefined): {
|
|
77
|
+
[kErrorCode]: ErrorCodes;
|
|
78
|
+
name: string;
|
|
79
|
+
message: string;
|
|
80
|
+
stack?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
83
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
84
|
+
stackTraceLimit: number;
|
|
85
|
+
};
|
|
86
|
+
export declare class ConfigError extends ConfigError_base {
|
|
87
|
+
}
|
|
88
|
+
declare const PluginError_base: {
|
|
89
|
+
new (err?: Error | undefined): {
|
|
90
|
+
[kErrorCode]: ErrorCodes;
|
|
91
|
+
name: string;
|
|
92
|
+
message: string;
|
|
93
|
+
stack?: string | undefined;
|
|
94
|
+
};
|
|
95
|
+
new (message?: string | undefined): {
|
|
96
|
+
[kErrorCode]: ErrorCodes;
|
|
97
|
+
name: string;
|
|
98
|
+
message: string;
|
|
99
|
+
stack?: string | undefined;
|
|
100
|
+
};
|
|
101
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
102
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
103
|
+
stackTraceLimit: number;
|
|
104
|
+
};
|
|
105
|
+
export declare class PluginError extends PluginError_base {
|
|
106
|
+
}
|
|
107
|
+
declare const TimeoutError_base: {
|
|
108
|
+
new (err?: Error | undefined): {
|
|
109
|
+
[kErrorCode]: ErrorCodes;
|
|
110
|
+
name: string;
|
|
111
|
+
message: string;
|
|
112
|
+
stack?: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
new (message?: string | undefined): {
|
|
115
|
+
[kErrorCode]: ErrorCodes;
|
|
116
|
+
name: string;
|
|
117
|
+
message: string;
|
|
118
|
+
stack?: string | undefined;
|
|
119
|
+
};
|
|
120
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
121
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
122
|
+
stackTraceLimit: number;
|
|
123
|
+
};
|
|
124
|
+
export declare class TimeoutError extends TimeoutError_base {
|
|
125
|
+
}
|
|
126
|
+
declare const StateError_base: {
|
|
127
|
+
new (err?: Error | undefined): {
|
|
128
|
+
[kErrorCode]: ErrorCodes;
|
|
129
|
+
name: string;
|
|
130
|
+
message: string;
|
|
131
|
+
stack?: string | undefined;
|
|
132
|
+
};
|
|
133
|
+
new (message?: string | undefined): {
|
|
134
|
+
[kErrorCode]: ErrorCodes;
|
|
135
|
+
name: string;
|
|
136
|
+
message: string;
|
|
137
|
+
stack?: string | undefined;
|
|
138
|
+
};
|
|
139
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
140
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
141
|
+
stackTraceLimit: number;
|
|
142
|
+
};
|
|
143
|
+
export declare class StateError extends StateError_base {
|
|
144
|
+
}
|
|
145
|
+
declare const ServerError_base: {
|
|
146
|
+
new (err?: Error | undefined): {
|
|
147
|
+
[kErrorCode]: ErrorCodes;
|
|
148
|
+
name: string;
|
|
149
|
+
message: string;
|
|
150
|
+
stack?: string | undefined;
|
|
151
|
+
};
|
|
152
|
+
new (message?: string | undefined): {
|
|
153
|
+
[kErrorCode]: ErrorCodes;
|
|
154
|
+
name: string;
|
|
155
|
+
message: string;
|
|
156
|
+
stack?: string | undefined;
|
|
157
|
+
};
|
|
158
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
159
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
160
|
+
stackTraceLimit: number;
|
|
161
|
+
};
|
|
162
|
+
export declare class ServerError extends ServerError_base {
|
|
163
|
+
}
|
|
164
|
+
declare const NetworkError_base: {
|
|
165
|
+
new (err?: Error | undefined): {
|
|
166
|
+
[kErrorCode]: ErrorCodes;
|
|
167
|
+
name: string;
|
|
168
|
+
message: string;
|
|
169
|
+
stack?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
new (message?: string | undefined): {
|
|
172
|
+
[kErrorCode]: ErrorCodes;
|
|
173
|
+
name: string;
|
|
174
|
+
message: string;
|
|
175
|
+
stack?: string | undefined;
|
|
176
|
+
};
|
|
177
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
178
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
179
|
+
stackTraceLimit: number;
|
|
180
|
+
};
|
|
181
|
+
export declare class NetworkError extends NetworkError_base {
|
|
182
|
+
}
|
|
183
|
+
declare const CircuitBreakerError_base: {
|
|
184
|
+
new (err?: Error | undefined): {
|
|
185
|
+
[kErrorCode]: ErrorCodes;
|
|
186
|
+
name: string;
|
|
187
|
+
message: string;
|
|
188
|
+
stack?: string | undefined;
|
|
189
|
+
};
|
|
190
|
+
new (message?: string | undefined): {
|
|
191
|
+
[kErrorCode]: ErrorCodes;
|
|
192
|
+
name: string;
|
|
193
|
+
message: string;
|
|
194
|
+
stack?: string | undefined;
|
|
195
|
+
};
|
|
196
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
197
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
198
|
+
stackTraceLimit: number;
|
|
199
|
+
};
|
|
200
|
+
export declare class CircuitBreakerError extends CircuitBreakerError_base {
|
|
201
|
+
}
|
|
202
|
+
declare const InvalidInstance_base: {
|
|
203
|
+
new (err?: Error | undefined): {
|
|
204
|
+
[kErrorCode]: ErrorCodes;
|
|
205
|
+
name: string;
|
|
206
|
+
message: string;
|
|
207
|
+
stack?: string | undefined;
|
|
208
|
+
};
|
|
209
|
+
new (message?: string | undefined): {
|
|
210
|
+
[kErrorCode]: ErrorCodes;
|
|
211
|
+
name: string;
|
|
212
|
+
message: string;
|
|
213
|
+
stack?: string | undefined;
|
|
214
|
+
};
|
|
215
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
216
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
217
|
+
stackTraceLimit: number;
|
|
218
|
+
};
|
|
219
|
+
export declare class InvalidInstance extends InvalidInstance_base {
|
|
220
|
+
}
|
|
221
|
+
declare const ServiceNotFound_base: {
|
|
222
|
+
new (err?: Error | undefined): {
|
|
223
|
+
[kErrorCode]: ErrorCodes;
|
|
224
|
+
name: string;
|
|
225
|
+
message: string;
|
|
226
|
+
stack?: string | undefined;
|
|
227
|
+
};
|
|
228
|
+
new (message?: string | undefined): {
|
|
229
|
+
[kErrorCode]: ErrorCodes;
|
|
230
|
+
name: string;
|
|
231
|
+
message: string;
|
|
232
|
+
stack?: string | undefined;
|
|
233
|
+
};
|
|
234
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
235
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
236
|
+
stackTraceLimit: number;
|
|
237
|
+
};
|
|
238
|
+
export declare class ServiceNotFound extends ServiceNotFound_base {
|
|
239
|
+
}
|
|
240
|
+
declare const LocationNotFound_base: {
|
|
241
|
+
new (err?: Error | undefined): {
|
|
242
|
+
[kErrorCode]: ErrorCodes;
|
|
243
|
+
name: string;
|
|
244
|
+
message: string;
|
|
245
|
+
stack?: string | undefined;
|
|
246
|
+
};
|
|
247
|
+
new (message?: string | undefined): {
|
|
248
|
+
[kErrorCode]: ErrorCodes;
|
|
249
|
+
name: string;
|
|
250
|
+
message: string;
|
|
251
|
+
stack?: string | undefined;
|
|
252
|
+
};
|
|
253
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
254
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
255
|
+
stackTraceLimit: number;
|
|
256
|
+
};
|
|
257
|
+
export declare class LocationNotFound extends LocationNotFound_base {
|
|
258
|
+
}
|
|
259
|
+
declare const InvalidRouteRule_base: {
|
|
260
|
+
new (err?: Error | undefined): {
|
|
261
|
+
[kErrorCode]: ErrorCodes;
|
|
262
|
+
name: string;
|
|
263
|
+
message: string;
|
|
264
|
+
stack?: string | undefined;
|
|
265
|
+
};
|
|
266
|
+
new (message?: string | undefined): {
|
|
267
|
+
[kErrorCode]: ErrorCodes;
|
|
268
|
+
name: string;
|
|
269
|
+
message: string;
|
|
270
|
+
stack?: string | undefined;
|
|
271
|
+
};
|
|
272
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
273
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
274
|
+
stackTraceLimit: number;
|
|
275
|
+
};
|
|
276
|
+
export declare class InvalidRouteRule extends InvalidRouteRule_base {
|
|
277
|
+
}
|
|
278
|
+
declare const InstanceNotFound_base: {
|
|
279
|
+
new (err?: Error | undefined): {
|
|
280
|
+
[kErrorCode]: ErrorCodes;
|
|
281
|
+
name: string;
|
|
282
|
+
message: string;
|
|
283
|
+
stack?: string | undefined;
|
|
284
|
+
};
|
|
285
|
+
new (message?: string | undefined): {
|
|
286
|
+
[kErrorCode]: ErrorCodes;
|
|
287
|
+
name: string;
|
|
288
|
+
message: string;
|
|
289
|
+
stack?: string | undefined;
|
|
290
|
+
};
|
|
291
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
292
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
293
|
+
stackTraceLimit: number;
|
|
294
|
+
};
|
|
295
|
+
export declare class InstanceNotFound extends InstanceNotFound_base {
|
|
296
|
+
}
|
|
297
|
+
declare const RouteRuleNotMatch_base: {
|
|
298
|
+
new (err?: Error | undefined): {
|
|
299
|
+
[kErrorCode]: ErrorCodes;
|
|
300
|
+
name: string;
|
|
301
|
+
message: string;
|
|
302
|
+
stack?: string | undefined;
|
|
303
|
+
};
|
|
304
|
+
new (message?: string | undefined): {
|
|
305
|
+
[kErrorCode]: ErrorCodes;
|
|
306
|
+
name: string;
|
|
307
|
+
message: string;
|
|
308
|
+
stack?: string | undefined;
|
|
309
|
+
};
|
|
310
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
311
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
312
|
+
stackTraceLimit: number;
|
|
313
|
+
};
|
|
314
|
+
export declare class RouteRuleNotMatch extends RouteRuleNotMatch_base {
|
|
315
|
+
}
|
|
316
|
+
declare const InvalidResponse_base: {
|
|
317
|
+
new (err?: Error | undefined): {
|
|
318
|
+
[kErrorCode]: ErrorCodes;
|
|
319
|
+
name: string;
|
|
320
|
+
message: string;
|
|
321
|
+
stack?: string | undefined;
|
|
322
|
+
};
|
|
323
|
+
new (message?: string | undefined): {
|
|
324
|
+
[kErrorCode]: ErrorCodes;
|
|
325
|
+
name: string;
|
|
326
|
+
message: string;
|
|
327
|
+
stack?: string | undefined;
|
|
328
|
+
};
|
|
329
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
330
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
331
|
+
stackTraceLimit: number;
|
|
332
|
+
};
|
|
333
|
+
export declare class InvalidResponse extends InvalidResponse_base {
|
|
334
|
+
}
|
|
335
|
+
declare const ServerException_base: {
|
|
336
|
+
new (err?: Error | undefined): {
|
|
337
|
+
[kErrorCode]: ErrorCodes;
|
|
338
|
+
name: string;
|
|
339
|
+
message: string;
|
|
340
|
+
stack?: string | undefined;
|
|
341
|
+
};
|
|
342
|
+
new (message?: string | undefined): {
|
|
343
|
+
[kErrorCode]: ErrorCodes;
|
|
344
|
+
name: string;
|
|
345
|
+
message: string;
|
|
346
|
+
stack?: string | undefined;
|
|
347
|
+
};
|
|
348
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
349
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
350
|
+
stackTraceLimit: number;
|
|
351
|
+
};
|
|
352
|
+
export declare class ServerException extends ServerException_base {
|
|
353
|
+
}
|
|
354
|
+
declare const InternalError_base: {
|
|
355
|
+
new (err?: Error | undefined): {
|
|
356
|
+
[kErrorCode]: ErrorCodes;
|
|
357
|
+
name: string;
|
|
358
|
+
message: string;
|
|
359
|
+
stack?: string | undefined;
|
|
360
|
+
};
|
|
361
|
+
new (message?: string | undefined): {
|
|
362
|
+
[kErrorCode]: ErrorCodes;
|
|
363
|
+
name: string;
|
|
364
|
+
message: string;
|
|
365
|
+
stack?: string | undefined;
|
|
366
|
+
};
|
|
367
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
|
|
368
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
369
|
+
stackTraceLimit: number;
|
|
370
|
+
};
|
|
371
|
+
export declare class InternalError extends InternalError_base {
|
|
372
|
+
}
|
|
373
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalError = exports.ServerException = exports.InvalidResponse = exports.RouteRuleNotMatch = exports.InstanceNotFound = exports.InvalidRouteRule = exports.LocationNotFound = exports.ServiceNotFound = exports.InvalidInstance = exports.CircuitBreakerError = exports.NetworkError = exports.ServerError = exports.StateError = exports.TimeoutError = exports.PluginError = exports.ConfigError = exports.ArgumentError = exports.FatalError = exports.PrimordialsError = exports.isPolarisError = exports.kErrorCode = exports.ErrorCodes = void 0;
|
|
4
|
+
const assert_1 = require("assert");
|
|
5
|
+
const util_1 = require("util");
|
|
6
|
+
var ErrorCodes;
|
|
7
|
+
(function (ErrorCodes) {
|
|
8
|
+
/** 接口参数错误 */
|
|
9
|
+
ErrorCodes["InvalidArgument"] = "ErrCodeAPIInvalidArgument";
|
|
10
|
+
/** 配置参数校验失败 */
|
|
11
|
+
ErrorCodes["InvalidConfig"] = "ErrCodeAPIInvalidConfig";
|
|
12
|
+
/** 插件调用异常 */
|
|
13
|
+
ErrorCodes["PluginError"] = "ErrCodePluginError";
|
|
14
|
+
/** 调用超时 */
|
|
15
|
+
ErrorCodes["TimeoutError"] = "ErrCodeAPITimeoutError";
|
|
16
|
+
/** 状态错误 */
|
|
17
|
+
ErrorCodes["StateError"] = "ErrCodeInvalidStateError";
|
|
18
|
+
/** 后端服务错误 */
|
|
19
|
+
ErrorCodes["ServerError"] = "ErrCodeServerError";
|
|
20
|
+
/** 网络异常 */
|
|
21
|
+
ErrorCodes["NetworkError"] = "ErrCodeNetworkError";
|
|
22
|
+
/** 服务熔断发生错误 */
|
|
23
|
+
ErrorCodes["CircuitBreakerError"] = "ErrCodeCircuitBreakerError";
|
|
24
|
+
/** 实例信息不合法 */
|
|
25
|
+
ErrorCodes["InvalidInstance"] = "ErrCodeInstanceInfoError";
|
|
26
|
+
/** 负载均衡、服务路由时,传入的服务没有实例信息 */
|
|
27
|
+
ErrorCodes["InstanceNotFound"] = "ErrCodeAPIInstanceNotFound";
|
|
28
|
+
/** 路由规则不合法 */
|
|
29
|
+
ErrorCodes["InvalidRouteRule"] = "ErrCodeInvalidRouteRule";
|
|
30
|
+
/** 路由规则无法匹配 */
|
|
31
|
+
ErrorCodes["RouteRuleNotMatch"] = "ErrCodeRouteRuleNotMatch";
|
|
32
|
+
/** 后端返回无效 */
|
|
33
|
+
ErrorCodes["InvalidResponse"] = "ErrCodeInvalidResponse";
|
|
34
|
+
/** 内部错误 */
|
|
35
|
+
ErrorCodes["InternalError"] = "ErrCodeInternalError";
|
|
36
|
+
/** 服务不存在 */
|
|
37
|
+
ErrorCodes["ServiceNotFound"] = "ErrCodeServiceNotFound";
|
|
38
|
+
/** 后端服务异常 */
|
|
39
|
+
ErrorCodes["ServerException"] = "ErrCodeServerException";
|
|
40
|
+
/** 获取位置信息失败 */
|
|
41
|
+
ErrorCodes["LocationNotFound"] = "ErrCodeLocationNotFound";
|
|
42
|
+
})(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {}));
|
|
43
|
+
exports.kErrorCode = Symbol("kErrorCode");
|
|
44
|
+
const defineProperties = (err, code) => Object.defineProperties(err, {
|
|
45
|
+
[exports.kErrorCode]: {
|
|
46
|
+
get() {
|
|
47
|
+
return code;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
[util_1.inspect.custom]: {
|
|
51
|
+
value(recurseTimes, ctx) {
|
|
52
|
+
return (0, util_1.inspect)(this, Object.assign(Object.assign({}, ctx), { getters: true, customInspect: false }));
|
|
53
|
+
},
|
|
54
|
+
writable: false,
|
|
55
|
+
configurable: false,
|
|
56
|
+
enumerable: false
|
|
57
|
+
},
|
|
58
|
+
[Symbol.toStringTag]: {
|
|
59
|
+
value() {
|
|
60
|
+
return `${this.name} [${this[exports.kErrorCode]}]: ${this.message}`;
|
|
61
|
+
},
|
|
62
|
+
writable: false,
|
|
63
|
+
configurable: false,
|
|
64
|
+
enumerable: false
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const addCodeToName = (err, code) => {
|
|
68
|
+
err.name = `${err.name} [${code}]`;
|
|
69
|
+
/** 访问 `stack` 属性,强制其生成的错误消息 */
|
|
70
|
+
const _ = err.stack; // eslint-disable-line @typescript-eslint/no-unused-vars, @typescript-eslint/naming-convention
|
|
71
|
+
/** 重置 `name` 为真实值 */
|
|
72
|
+
delete err.name;
|
|
73
|
+
};
|
|
74
|
+
exports.isPolarisError = ((err) => Object.prototype.hasOwnProperty.call(err, exports.kErrorCode));
|
|
75
|
+
const makePolarisError = (code, BaseError) => (class extends BaseError {
|
|
76
|
+
constructor(arg) {
|
|
77
|
+
if (arg instanceof Error) {
|
|
78
|
+
if ((0, exports.isPolarisError)(arg)) {
|
|
79
|
+
return arg;
|
|
80
|
+
}
|
|
81
|
+
return defineProperties(arg, code);
|
|
82
|
+
}
|
|
83
|
+
super(arg);
|
|
84
|
+
defineProperties(this, code);
|
|
85
|
+
addCodeToName(this, code);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
/** Node.js internal primordials Error */
|
|
89
|
+
exports.PrimordialsError = Reflect.getPrototypeOf(assert_1.AssertionError);
|
|
90
|
+
class FatalError extends assert_1.AssertionError {
|
|
91
|
+
constructor(message, fn) {
|
|
92
|
+
super({
|
|
93
|
+
message,
|
|
94
|
+
stackStartFn: fn || FatalError,
|
|
95
|
+
stackStartFunction: fn || FatalError // 兼容老版本的 Node.js
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
get [exports.kErrorCode]() {
|
|
99
|
+
return ErrorCodes.InternalError;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.FatalError = FatalError;
|
|
103
|
+
class ArgumentError extends makePolarisError(ErrorCodes.InvalidArgument, TypeError) {
|
|
104
|
+
}
|
|
105
|
+
exports.ArgumentError = ArgumentError;
|
|
106
|
+
class ConfigError extends makePolarisError(ErrorCodes.InvalidConfig, TypeError) {
|
|
107
|
+
}
|
|
108
|
+
exports.ConfigError = ConfigError;
|
|
109
|
+
class PluginError extends makePolarisError(ErrorCodes.PluginError, Error) {
|
|
110
|
+
}
|
|
111
|
+
exports.PluginError = PluginError;
|
|
112
|
+
class TimeoutError extends makePolarisError(ErrorCodes.TimeoutError, Error) {
|
|
113
|
+
}
|
|
114
|
+
exports.TimeoutError = TimeoutError;
|
|
115
|
+
class StateError extends makePolarisError(ErrorCodes.StateError, Error) {
|
|
116
|
+
}
|
|
117
|
+
exports.StateError = StateError;
|
|
118
|
+
class ServerError extends makePolarisError(ErrorCodes.ServerError, Error) {
|
|
119
|
+
}
|
|
120
|
+
exports.ServerError = ServerError;
|
|
121
|
+
class NetworkError extends makePolarisError(ErrorCodes.NetworkError, Error) {
|
|
122
|
+
}
|
|
123
|
+
exports.NetworkError = NetworkError;
|
|
124
|
+
class CircuitBreakerError extends makePolarisError(ErrorCodes.CircuitBreakerError, Error) {
|
|
125
|
+
}
|
|
126
|
+
exports.CircuitBreakerError = CircuitBreakerError;
|
|
127
|
+
class InvalidInstance extends makePolarisError(ErrorCodes.InvalidInstance, TypeError) {
|
|
128
|
+
}
|
|
129
|
+
exports.InvalidInstance = InvalidInstance;
|
|
130
|
+
class ServiceNotFound extends makePolarisError(ErrorCodes.ServiceNotFound, Error) {
|
|
131
|
+
}
|
|
132
|
+
exports.ServiceNotFound = ServiceNotFound;
|
|
133
|
+
class LocationNotFound extends makePolarisError(ErrorCodes.LocationNotFound, Error) {
|
|
134
|
+
}
|
|
135
|
+
exports.LocationNotFound = LocationNotFound;
|
|
136
|
+
class InvalidRouteRule extends makePolarisError(ErrorCodes.InvalidRouteRule, Error) {
|
|
137
|
+
}
|
|
138
|
+
exports.InvalidRouteRule = InvalidRouteRule;
|
|
139
|
+
class InstanceNotFound extends makePolarisError(ErrorCodes.InstanceNotFound, Error) {
|
|
140
|
+
}
|
|
141
|
+
exports.InstanceNotFound = InstanceNotFound;
|
|
142
|
+
class RouteRuleNotMatch extends makePolarisError(ErrorCodes.RouteRuleNotMatch, Error) {
|
|
143
|
+
}
|
|
144
|
+
exports.RouteRuleNotMatch = RouteRuleNotMatch;
|
|
145
|
+
class InvalidResponse extends makePolarisError(ErrorCodes.InvalidResponse, Error) {
|
|
146
|
+
}
|
|
147
|
+
exports.InvalidResponse = InvalidResponse;
|
|
148
|
+
class ServerException extends makePolarisError(ErrorCodes.ServerException, Error) {
|
|
149
|
+
}
|
|
150
|
+
exports.ServerException = ServerException;
|
|
151
|
+
class InternalError extends makePolarisError(ErrorCodes.InternalError, Error) {
|
|
152
|
+
}
|
|
153
|
+
exports.InternalError = InternalError;
|
|
154
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const kDefaultOptions: {
|
|
2
|
+
/**
|
|
3
|
+
* 全局变量
|
|
4
|
+
*/
|
|
5
|
+
globalVariables: Record<string, string>;
|
|
6
|
+
/**
|
|
7
|
+
* 开启状态上报
|
|
8
|
+
*/
|
|
9
|
+
enableReporter: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare type GlobalOptions = typeof kDefaultOptions;
|
|
12
|
+
export declare function createGlobalOptions(options?: Partial<GlobalOptions>): {
|
|
13
|
+
globalVariables: Record<string, string>;
|
|
14
|
+
enableReporter: boolean;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createGlobalOptions = void 0;
|
|
4
|
+
const kDefaultOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* 全局变量
|
|
7
|
+
*/
|
|
8
|
+
globalVariables: Object.create(null),
|
|
9
|
+
/**
|
|
10
|
+
* 开启状态上报
|
|
11
|
+
*/
|
|
12
|
+
enableReporter: process.env.POLARIS_ENABLE_REPORTER !== "0"
|
|
13
|
+
};
|
|
14
|
+
function createGlobalOptions(options) {
|
|
15
|
+
return Object.assign(Object.assign({}, kDefaultOptions), options);
|
|
16
|
+
}
|
|
17
|
+
exports.createGlobalOptions = createGlobalOptions;
|
|
18
|
+
//# sourceMappingURL=global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global.js","sourceRoot":"","sources":["../src/global.ts"],"names":[],"mappings":";;;AAAA,MAAM,eAAe,GAAG;IACtB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAA2B;IAE9D;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,GAAG;CAC5D,CAAC;AAIF,SAAgB,mBAAmB,CAAC,OAAgC;IAClE,uCACK,eAAe,GACf,OAAO,EACV;AACJ,CAAC;AALD,kDAKC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Consumer as PolarisMeshConsumer, OptionalConsumerPluginList, ConsumerOptions, Provider as PolarisMeshProvider, OptionalProviderPluginList, ProviderOptions, Limiter as PolarisMeshLimiter, OptionalLimiterPluginList, LimiterOptions, PolarisGRPCClient as PolarisMeshGRPCClient, PolarisHTTPClient as PolarisMeshHTTPClient, PolarisHTTPClientOptions } from "./polaris";
|
|
2
|
+
export * from "./polaris";
|
|
3
|
+
export declare const getEmbeddedDiscoverHosts: (port?: number | undefined) => string[];
|
|
4
|
+
export declare class PolarisHTTPClient extends PolarisMeshHTTPClient {
|
|
5
|
+
constructor(remotes?: string[], options?: Partial<PolarisHTTPClientOptions>);
|
|
6
|
+
/**
|
|
7
|
+
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
8
|
+
* @returns always `false`
|
|
9
|
+
*/
|
|
10
|
+
serviceStatistics(): Promise<boolean>;
|
|
11
|
+
/**
|
|
12
|
+
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
13
|
+
* @returns always `false`
|
|
14
|
+
*/
|
|
15
|
+
registryCache(): Promise<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
18
|
+
* @returns always `false`
|
|
19
|
+
*/
|
|
20
|
+
apiStatistics(): Promise<boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
23
|
+
* @returns always `false`
|
|
24
|
+
*/
|
|
25
|
+
systemConfig(): Promise<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* HTTP 后端默认没有部署上报模块,故移除相关实现
|
|
28
|
+
* @returns always `false`
|
|
29
|
+
*/
|
|
30
|
+
statusChangelog(): Promise<boolean>;
|
|
31
|
+
}
|
|
32
|
+
export declare class PolarisGRPCClient extends PolarisMeshGRPCClient {
|
|
33
|
+
constructor(remotes?: string[], options?: ConstructorParameters<typeof PolarisMeshGRPCClient>[1]);
|
|
34
|
+
}
|
|
35
|
+
export declare const PolarisServerClient: typeof PolarisHTTPClient | typeof PolarisGRPCClient;
|
|
36
|
+
export declare type ConsumerPluginList = Required<OptionalConsumerPluginList>;
|
|
37
|
+
export declare class Consumer extends PolarisMeshConsumer {
|
|
38
|
+
/**
|
|
39
|
+
* Create Consumer
|
|
40
|
+
* @param plugins 插件(可选)
|
|
41
|
+
* @param options 配置参数(可选)
|
|
42
|
+
*/
|
|
43
|
+
constructor(plugins?: Partial<ConsumerPluginList>, options?: Partial<ConsumerOptions>);
|
|
44
|
+
}
|
|
45
|
+
export declare type ProviderPluginList = Required<OptionalProviderPluginList>;
|
|
46
|
+
export declare class Provider extends PolarisMeshProvider {
|
|
47
|
+
/**
|
|
48
|
+
* Create Provider
|
|
49
|
+
* @param plugins 插件(可选)
|
|
50
|
+
* @param options 配置参数(可选)
|
|
51
|
+
*/
|
|
52
|
+
constructor(plugins?: Partial<ProviderPluginList>, options?: Partial<ProviderOptions>);
|
|
53
|
+
}
|
|
54
|
+
export declare type LimiterPluginList = Required<OptionalLimiterPluginList>;
|
|
55
|
+
export declare class Limiter extends PolarisMeshLimiter {
|
|
56
|
+
/**
|
|
57
|
+
* Create Limiter
|
|
58
|
+
* @param plugins 插件(可选)
|
|
59
|
+
* @param options 配置参数(可选)
|
|
60
|
+
*/
|
|
61
|
+
constructor(plugins?: Partial<LimiterPluginList>, options?: Partial<LimiterOptions>);
|
|
62
|
+
}
|