@tencentcloud/sdk-mcp 0.1.0 → 1.0.1
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/node_modules/axios/CHANGELOG.md +891 -0
- package/@tencent/polaris/node_modules/axios/LICENSE +19 -0
- package/@tencent/polaris/node_modules/axios/README.md +908 -0
- package/@tencent/polaris/node_modules/axios/SECURITY.md +5 -0
- package/@tencent/polaris/node_modules/axios/UPGRADE_GUIDE.md +168 -0
- package/@tencent/polaris/node_modules/axios/dist/axios.js +2277 -0
- package/@tencent/polaris/node_modules/axios/dist/axios.map +1 -0
- package/@tencent/polaris/node_modules/axios/dist/axios.min.js +4 -0
- package/@tencent/polaris/node_modules/axios/dist/axios.min.map +1 -0
- package/@tencent/polaris/node_modules/axios/index.d.ts +221 -0
- package/@tencent/polaris/node_modules/axios/index.js +1 -0
- package/@tencent/polaris/node_modules/axios/lib/adapters/README.md +37 -0
- package/@tencent/polaris/node_modules/axios/lib/adapters/http.js +388 -0
- package/@tencent/polaris/node_modules/axios/lib/adapters/xhr.js +212 -0
- package/@tencent/polaris/node_modules/axios/lib/axios.js +57 -0
- package/@tencent/polaris/node_modules/axios/lib/cancel/Cancel.js +19 -0
- package/@tencent/polaris/node_modules/axios/lib/cancel/CancelToken.js +119 -0
- package/@tencent/polaris/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/@tencent/polaris/node_modules/axios/lib/core/Axios.js +155 -0
- package/@tencent/polaris/node_modules/axios/lib/core/InterceptorManager.js +54 -0
- package/@tencent/polaris/node_modules/axios/lib/core/README.md +8 -0
- package/@tencent/polaris/node_modules/axios/lib/core/buildFullPath.js +20 -0
- package/@tencent/polaris/node_modules/axios/lib/core/createError.js +18 -0
- package/@tencent/polaris/node_modules/axios/lib/core/dispatchRequest.js +87 -0
- package/@tencent/polaris/node_modules/axios/lib/core/enhanceError.js +43 -0
- package/@tencent/polaris/node_modules/axios/lib/core/mergeConfig.js +99 -0
- package/@tencent/polaris/node_modules/axios/lib/core/settle.js +25 -0
- package/@tencent/polaris/node_modules/axios/lib/core/transformData.js +22 -0
- package/@tencent/polaris/node_modules/axios/lib/defaults.js +134 -0
- package/@tencent/polaris/node_modules/axios/lib/env/README.md +3 -0
- package/@tencent/polaris/node_modules/axios/lib/env/data.js +3 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/README.md +7 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/bind.js +11 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/buildURL.js +70 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/combineURLs.js +14 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/cookies.js +53 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/deprecatedMethod.js +24 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/isAbsoluteURL.js +14 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/isAxiosError.js +13 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/isURLSameOrigin.js +68 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/normalizeHeaderName.js +12 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/parseHeaders.js +53 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/spread.js +27 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/toFormData.js +55 -0
- package/@tencent/polaris/node_modules/axios/lib/helpers/validator.js +82 -0
- package/@tencent/polaris/node_modules/axios/lib/utils.js +349 -0
- package/@tencent/polaris/node_modules/axios/package.json +86 -0
- package/@tencent/polaris/node_modules/axios/tsconfig.json +14 -0
- package/@tencent/polaris/node_modules/axios/tslint.json +6 -0
- package/@tencent/polaris/package.json +114 -0
- package/README.md +41 -0
- package/cursor-setting.png +0 -0
- package/mcp-server-prompt.png +0 -0
- package/mcp.json +9 -0
- package/package.json +13 -2
- package/server.js +8 -0
- package/server.js.map +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Config } from '../interface';
|
|
2
|
+
export declare const REPORT_TIMEOUT = 5000;
|
|
3
|
+
export declare const MAX_FAIL_REQUEST_NUM = 60;
|
|
4
|
+
export declare const MAX_LOG_LENGTH: number;
|
|
5
|
+
export declare const MAX_FROM_LENGTH: number;
|
|
6
|
+
export declare const TIMESTAMP_REG: RegExp;
|
|
7
|
+
export declare const MAX_REPEAT_TIMES = 60;
|
|
8
|
+
export declare const CLEAR_REPEAT_CACHE_TIMEOUT = 60000;
|
|
9
|
+
export declare const MAX_CUSTOM_TIME = 2147483646;
|
|
10
|
+
export declare const MAX_ERROR_COUNT = 5;
|
|
11
|
+
export declare const FORBIDDEN_RESPONSE_DATA = "403 forbidden";
|
|
12
|
+
export declare const MAX_PROMISE_ERROR_MSG_LENGTH = 150;
|
|
13
|
+
export declare const getDefaultConfig: () => Config;
|
|
14
|
+
export declare const setConfigUrl: (config: Config, hostUrl?: string) => Config;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const globalAny: any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { getDefaultConfig, setConfigUrl, REPORT_TIMEOUT, MAX_FAIL_REQUEST_NUM, MAX_LOG_LENGTH, MAX_FROM_LENGTH, MAX_REPEAT_TIMES, CLEAR_REPEAT_CACHE_TIMEOUT, FORBIDDEN_RESPONSE_DATA, TIMESTAMP_REG, MAX_CUSTOM_TIME, MAX_ERROR_COUNT, MAX_PROMISE_ERROR_MSG_LENGTH, } from './config';
|
|
2
|
+
export { URL_SPEED_IGNORE, ERROR_MSG_IGNORE, } from './report-ignore';
|
|
3
|
+
export declare const COMPLETION_KEYS: string[];
|
|
4
|
+
export declare const RESOURCE_TYPE_STATIC = "static";
|
|
5
|
+
export declare const RESOURCE_TYPE_FETCH = "fetch";
|
|
6
|
+
export declare const RESOURCE_TYPE: string[];
|
|
7
|
+
export declare const UNKNOWN = "unknown";
|
|
8
|
+
export declare const UNKNOWN_CHINESE = "\u672A\u77E5";
|
|
9
|
+
export * from './global';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { InterfaceEventEmitter } from './util';
|
|
2
|
+
import { Config, LogType, Environment, SendOption, SendSuccess, SendFail, SpeedLog, BridgeLog, ReportTimeLog, SendType, EventLog } from './interface';
|
|
3
|
+
import Plugin from './plugin';
|
|
4
|
+
import { Pipe } from './pipes';
|
|
5
|
+
/**
|
|
6
|
+
* Aegis 核心逻辑,所有平台的 Aegis 类都继承于 Core
|
|
7
|
+
* 类似 linux 微内核的架构组织代码
|
|
8
|
+
* 所有 Aegis 的功能都是基于 Core 实现
|
|
9
|
+
* 1. 封装了 Aegis 的基本属性和方法
|
|
10
|
+
* 2. 封装了 Aegis 的插件模型,Aegis 中所有数据采集的逻辑均基于插件体系实现
|
|
11
|
+
* 3. 封装了 Aegis 的基础实例方法,包括 info report reportEvent 等,平台无需自己重复实现
|
|
12
|
+
* 4. 封装了 Aegis 的生命周期,实现生命周期管理
|
|
13
|
+
*/
|
|
14
|
+
export default class Core {
|
|
15
|
+
static version: string;
|
|
16
|
+
static instances: Core[];
|
|
17
|
+
static logType: typeof LogType;
|
|
18
|
+
static environment: typeof Environment;
|
|
19
|
+
static installedPlugins: Plugin[];
|
|
20
|
+
/**
|
|
21
|
+
* 使用插件
|
|
22
|
+
* @param plugin
|
|
23
|
+
*/
|
|
24
|
+
static use(plugin: Plugin): void;
|
|
25
|
+
/**
|
|
26
|
+
* 销毁插件
|
|
27
|
+
* @param plugin
|
|
28
|
+
*/
|
|
29
|
+
static unuse(plugin: Plugin): void;
|
|
30
|
+
isGetSample: boolean;
|
|
31
|
+
isHidden: boolean;
|
|
32
|
+
config: Config;
|
|
33
|
+
isWhiteList: boolean;
|
|
34
|
+
lifeCycle: InterfaceEventEmitter;
|
|
35
|
+
bean: {
|
|
36
|
+
[key: string]: string | number | boolean;
|
|
37
|
+
};
|
|
38
|
+
sendNow: boolean;
|
|
39
|
+
normalLogPipeline: import("./pipes").Pipeline<any, any>;
|
|
40
|
+
eventPipeline: import("./pipes").Pipeline<any, any>;
|
|
41
|
+
customTimePipeline: import("./pipes").Pipeline<any, any>;
|
|
42
|
+
private timeMap;
|
|
43
|
+
private failRequestCount;
|
|
44
|
+
/**
|
|
45
|
+
* 构造函数
|
|
46
|
+
* @param config
|
|
47
|
+
*/
|
|
48
|
+
constructor(config: Config);
|
|
49
|
+
/**
|
|
50
|
+
* 初始化方法,用于记录用户传入参数和初始化 SDK 所有插件
|
|
51
|
+
* @param config
|
|
52
|
+
*/
|
|
53
|
+
init(config: Config): void;
|
|
54
|
+
/**
|
|
55
|
+
* 销毁 Aegis 实例,清空 Aegis 实例属性和方法,销毁插件
|
|
56
|
+
* @param force
|
|
57
|
+
*/
|
|
58
|
+
destroy(force?: boolean): void;
|
|
59
|
+
/**
|
|
60
|
+
* 设置属性,这个方法也暴露给用户,方便用户动态修改 SDK 属性
|
|
61
|
+
* @param config
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
setConfig(config: Partial<Config>): Config;
|
|
65
|
+
extendBean(key: string, value: string | number): void;
|
|
66
|
+
send(options: SendOption, success?: SendSuccess, fail?: SendFail): any;
|
|
67
|
+
sendSDKError(err: Error): void;
|
|
68
|
+
sendPipeline(pipes: Pipe[], type: SendType): import("./pipes").Pipeline<any, any>;
|
|
69
|
+
info(...msg: any): void;
|
|
70
|
+
infoAll(...msg: any): void;
|
|
71
|
+
report(...msg: any): void;
|
|
72
|
+
error(...msg: any): void;
|
|
73
|
+
reportEvent(event: string | EventLog): void;
|
|
74
|
+
reportT(obj: ReportTimeLog): void;
|
|
75
|
+
reportTime(key: string | ReportTimeLog, duration?: number): void;
|
|
76
|
+
time(key: string): void;
|
|
77
|
+
timeEnd(key: string): void;
|
|
78
|
+
ready(_options: SendOption, _success?: SendSuccess, _fail?: SendFail): void;
|
|
79
|
+
request(_options: SendOption, _success?: SendSuccess, _fail?: SendFail): void;
|
|
80
|
+
speedLogPipeline(_log?: SpeedLog | SpeedLog[] | BridgeLog | BridgeLog[]): void;
|
|
81
|
+
get __version__(): string;
|
|
82
|
+
get LogType(): typeof LogType;
|
|
83
|
+
reportPv(id: number): void;
|
|
84
|
+
private submitCustomTime;
|
|
85
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Core from '../core';
|
|
2
|
+
import { SendType } from '../interface';
|
|
3
|
+
import { Pipe } from '../pipes';
|
|
4
|
+
/**
|
|
5
|
+
* beforeRequest 是 Aegis SDK 中最重要的 hook,可以拦截和修改所有的上报
|
|
6
|
+
* 当 beforeRequest 返回 false 的时候,这条日志就不会上报
|
|
7
|
+
* 当 beforeRequest 返回正常的log结构体的时候,Aegis 会按照返回值里面的数据,自动上报相应的数据
|
|
8
|
+
*/
|
|
9
|
+
export declare const beforeRequestHooks: (aegis: Core, logType: SendType | undefined) => Pipe;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './polyfill';
|
|
2
|
+
import Core from './core';
|
|
3
|
+
import Plugin from './plugin';
|
|
4
|
+
export { Plugin };
|
|
5
|
+
export default Core;
|
|
6
|
+
export { LogType, NormalLog, SpeedLog, BridgeLog, StaticAssetsLog, PagePerformanceLog, PagePerformanceLogForHippy3, HippyPagePerformanceLog, Config, CoreApiConfig, SendOption, SendSuccess, SendFail, SendType, PlatTypeNum, NetworkTypeNum, PagePerformanceStruct, } from './interface';
|
|
7
|
+
export { getDefaultConfig, setConfigUrl, globalAny, REPORT_TIMEOUT, MAX_FROM_LENGTH, ERROR_MSG_IGNORE, URL_SPEED_IGNORE, RESOURCE_TYPE_FETCH, RESOURCE_TYPE_STATIC, UNKNOWN, RESOURCE_TYPE, MAX_PROMISE_ERROR_MSG_LENGTH, } from './constant';
|
|
8
|
+
export * from './pipes';
|
|
9
|
+
export * from './util';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 配置Interface
|
|
3
|
+
*/
|
|
4
|
+
export declare type CoreApiConfig = {
|
|
5
|
+
apiDetail?: boolean;
|
|
6
|
+
reportRequest?: boolean;
|
|
7
|
+
resourceTypeHandler?: Function | undefined;
|
|
8
|
+
retCodeHandler?: Function | undefined;
|
|
9
|
+
reqParamHandler?: Function | undefined;
|
|
10
|
+
resBodyHandler?: Function | undefined;
|
|
11
|
+
resHeaders?: Array<string>;
|
|
12
|
+
reqHeaders?: Array<string>;
|
|
13
|
+
};
|
|
14
|
+
export interface Config {
|
|
15
|
+
id?: string;
|
|
16
|
+
uin?: number | string;
|
|
17
|
+
aid?: boolean | string;
|
|
18
|
+
onError?: boolean;
|
|
19
|
+
device?: boolean;
|
|
20
|
+
env?: string;
|
|
21
|
+
version?: number | string;
|
|
22
|
+
delay?: number;
|
|
23
|
+
repeat?: number | object;
|
|
24
|
+
random?: number;
|
|
25
|
+
speedSample?: boolean;
|
|
26
|
+
hostUrl?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
customTimeUrl?: string;
|
|
30
|
+
whiteListUrl?: string;
|
|
31
|
+
offlineUrl?: string;
|
|
32
|
+
pvUrl?: string;
|
|
33
|
+
speedUrl?: string;
|
|
34
|
+
performanceUrl?: string;
|
|
35
|
+
performanceUrlForHippy?: string;
|
|
36
|
+
eventUrl?: string;
|
|
37
|
+
webVitalsUrl?: string;
|
|
38
|
+
setDataReportUrl?: string;
|
|
39
|
+
pageUrl?: string;
|
|
40
|
+
getNetworkType?: Function;
|
|
41
|
+
websocketHack?: boolean;
|
|
42
|
+
beforeReport?: Function;
|
|
43
|
+
logCreated?: Function;
|
|
44
|
+
onReport?: Function;
|
|
45
|
+
onWhitelist?: Function;
|
|
46
|
+
api?: CoreApiConfig;
|
|
47
|
+
beforeReportSpeed?: Function;
|
|
48
|
+
reportAssetSpeed?: boolean | object;
|
|
49
|
+
beforeRequest?: Function;
|
|
50
|
+
afterRequest?: Function;
|
|
51
|
+
urlHandler?: Function;
|
|
52
|
+
ext1?: string;
|
|
53
|
+
ext2?: string;
|
|
54
|
+
ext3?: string;
|
|
55
|
+
destroy?: Function;
|
|
56
|
+
pagePerformance?: boolean | PagePerformanceStruct;
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
export interface PagePerformanceStruct {
|
|
60
|
+
firstScreenInfo?: false;
|
|
61
|
+
urlHandler?: () => string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum Environment {
|
|
2
|
+
production = "production",
|
|
3
|
+
development = "development",
|
|
4
|
+
gray = "gray",
|
|
5
|
+
pre = "pre",
|
|
6
|
+
daily = "daily",
|
|
7
|
+
local = "local",
|
|
8
|
+
test = "test",
|
|
9
|
+
others = "others"
|
|
10
|
+
}
|
|
11
|
+
export declare const isEnvironment: (val: string) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Config, CoreApiConfig, PagePerformanceStruct } from './config';
|
|
2
|
+
export { NormalLog, SpeedLog, BridgeLog, StaticAssetsLog, PagePerformanceLog, PagePerformanceLogForHippy3, HippyPagePerformanceLog, LogType, ReportTimeLog, EventLog, PlatTypeNum, NetworkTypeNum, } from './log';
|
|
3
|
+
export { SendOption, SendSuccess, SendFail, SendType, } from './send';
|
|
4
|
+
export { Environment, } from './env';
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
export declare enum LogType {
|
|
2
|
+
INFO_ALL = "-1",
|
|
3
|
+
API_RESPONSE = "1",
|
|
4
|
+
INFO = "2",
|
|
5
|
+
ERROR = "4",
|
|
6
|
+
PROMISE_ERROR = "8",
|
|
7
|
+
AJAX_ERROR = "16",
|
|
8
|
+
SCRIPT_ERROR = "32",
|
|
9
|
+
IMAGE_ERROR = "64",
|
|
10
|
+
CSS_ERROR = "128",
|
|
11
|
+
CONSOLE_ERROR = "256",
|
|
12
|
+
MEDIA_ERROR = "512",
|
|
13
|
+
RET_ERROR = "1024",
|
|
14
|
+
PAGE_LOAD = "1025",
|
|
15
|
+
SLOW_PAGE_LOAD = "1026",
|
|
16
|
+
SLOW_NET_REQUEST = "1027",
|
|
17
|
+
ASSERT_REQUEST = "1028",
|
|
18
|
+
SLOW_ASSET_REQUEST = "1029",
|
|
19
|
+
CLICK_EVENT = "1030",
|
|
20
|
+
CONSOLE_LOG = "1031",
|
|
21
|
+
REPORT = "2048",
|
|
22
|
+
PV = "4096",
|
|
23
|
+
EVENT = "8192",
|
|
24
|
+
SPEED_EVENT = "8193",
|
|
25
|
+
PAGE_NOT_FOUND_ERROR = "16384",
|
|
26
|
+
WEBSOCKET_ERROR = "32768",
|
|
27
|
+
BRIDGE_ERROR = "65536",
|
|
28
|
+
LAZY_LOAD_ERROR = "131072"
|
|
29
|
+
}
|
|
30
|
+
export declare enum PlatTypeNum {
|
|
31
|
+
android = 1,
|
|
32
|
+
ios = 2,
|
|
33
|
+
windows = 3,
|
|
34
|
+
macos = 4,
|
|
35
|
+
linux = 5,
|
|
36
|
+
devtools = 6,
|
|
37
|
+
other = 100
|
|
38
|
+
}
|
|
39
|
+
export declare enum NetworkTypeNum {
|
|
40
|
+
unknown = 100,
|
|
41
|
+
wifi = 1,
|
|
42
|
+
net2g = 2,
|
|
43
|
+
net3g = 3,
|
|
44
|
+
net4g = 4,
|
|
45
|
+
net5g = 5,
|
|
46
|
+
net6g = 6
|
|
47
|
+
}
|
|
48
|
+
export interface NormalLog {
|
|
49
|
+
msg: any;
|
|
50
|
+
level: LogType;
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}
|
|
53
|
+
export interface SpeedLog {
|
|
54
|
+
url: string;
|
|
55
|
+
isHttps: boolean;
|
|
56
|
+
method: string;
|
|
57
|
+
type: 'static' | 'fetch';
|
|
58
|
+
duration?: number;
|
|
59
|
+
nextHopProtocol?: string;
|
|
60
|
+
ret?: string | number | 'unknown';
|
|
61
|
+
status?: number;
|
|
62
|
+
isErr?: number;
|
|
63
|
+
payload?: any;
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}
|
|
66
|
+
export interface BridgeLog {
|
|
67
|
+
name: string;
|
|
68
|
+
type: 'bridge';
|
|
69
|
+
duration?: number;
|
|
70
|
+
ret?: string | number | 'unknown';
|
|
71
|
+
isErr?: number;
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}
|
|
74
|
+
export interface PagePerformanceLog {
|
|
75
|
+
dnsLookup: number;
|
|
76
|
+
tcp: number;
|
|
77
|
+
ssl: number;
|
|
78
|
+
ttfb: number;
|
|
79
|
+
contentDownload: number;
|
|
80
|
+
domParse: number;
|
|
81
|
+
resourceDownload: number;
|
|
82
|
+
firstScreenTiming: number;
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
}
|
|
85
|
+
export interface PagePerformanceLogForHippy3 {
|
|
86
|
+
nativeInit: number;
|
|
87
|
+
jsEngineInit: number;
|
|
88
|
+
runApplication: number;
|
|
89
|
+
firstFrame: number;
|
|
90
|
+
executeSource: number;
|
|
91
|
+
loadSource: number;
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}
|
|
94
|
+
export interface HippyPagePerformanceLog {
|
|
95
|
+
engineInit: number;
|
|
96
|
+
bundleLoad: number;
|
|
97
|
+
firstScreenTiming: number;
|
|
98
|
+
firstScreenRequest: number;
|
|
99
|
+
loadEnd: number;
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
}
|
|
102
|
+
export interface StaticAssetsLog {
|
|
103
|
+
url: string;
|
|
104
|
+
isHttps: boolean;
|
|
105
|
+
method: string;
|
|
106
|
+
type: 'static' | 'fetch';
|
|
107
|
+
duration?: number;
|
|
108
|
+
nextHopProtocol?: string;
|
|
109
|
+
ret?: string | 'unknown';
|
|
110
|
+
status?: number;
|
|
111
|
+
domainLookup: number;
|
|
112
|
+
connectTime: number;
|
|
113
|
+
urlQuery: string;
|
|
114
|
+
transferSize?: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ReportTimeLog {
|
|
117
|
+
name: string;
|
|
118
|
+
duration: number;
|
|
119
|
+
ext1?: string;
|
|
120
|
+
ext2?: string;
|
|
121
|
+
ext3?: string;
|
|
122
|
+
from?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface EventLog {
|
|
125
|
+
name: string;
|
|
126
|
+
ext1?: string;
|
|
127
|
+
ext2?: string;
|
|
128
|
+
ext3?: string;
|
|
129
|
+
from?: string;
|
|
130
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface SendOption {
|
|
2
|
+
url: string;
|
|
3
|
+
method?: 'get' | 'post';
|
|
4
|
+
contentType?: string;
|
|
5
|
+
data?: any;
|
|
6
|
+
addBean?: boolean;
|
|
7
|
+
from?: string;
|
|
8
|
+
beanFilter?: string[];
|
|
9
|
+
type?: SendType;
|
|
10
|
+
log?: any;
|
|
11
|
+
success?: (data: any) => void;
|
|
12
|
+
fail?: (err: any) => void;
|
|
13
|
+
sendBeacon?: boolean;
|
|
14
|
+
requestConfig?: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare enum SendType {
|
|
19
|
+
LOG = "log",
|
|
20
|
+
SPEED = "speed",
|
|
21
|
+
PERFORMANCE = "performance",
|
|
22
|
+
OFFLINE = "offline",
|
|
23
|
+
WHITE_LIST = "whiteList",
|
|
24
|
+
VITALS = "vitals",
|
|
25
|
+
PV = "pv",
|
|
26
|
+
CUSTOM_PV = "customPV",
|
|
27
|
+
EVENT = "event",
|
|
28
|
+
CUSTOM = "custom",
|
|
29
|
+
SDK_ERROR = "sdkError",
|
|
30
|
+
SET_DATA = "setData",
|
|
31
|
+
LOAD_PACKAGE = "loadPackage"
|
|
32
|
+
}
|
|
33
|
+
export declare type SendSuccess = (data: any) => void;
|
|
34
|
+
export declare type SendFail = (err: any) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { createRandomSamplePipe } from './sample';
|
|
2
|
+
export { createWriteReportPipe } from './write-before';
|
|
3
|
+
export { createThrottlePipe } from './throttle';
|
|
4
|
+
export { formatNormalLogPipe } from './format';
|
|
5
|
+
export { createLimitLengthPipe } from './length-limit';
|
|
6
|
+
export { createWhitelistPipe } from './whitelist';
|
|
7
|
+
export { removePayloadPipe } from './remove-payload';
|
|
8
|
+
export { createPvPipe } from './pv';
|
|
9
|
+
export { createSpeedRepeatLimitPipe, createErrorLogLimitPipe } from './repeat-limit';
|
|
10
|
+
export { reportPipe, reportEventPipe, reportCustomPipe } from './report';
|
|
11
|
+
export { beforeRequestHooks } from '../hooks/beforeRequestHooks';
|
|
12
|
+
export { modifyRequestHooks } from '../hooks/modifyRequestHooks';
|
|
13
|
+
export { afterRequestHooks } from '../hooks/afterRequestHooks';
|
|
14
|
+
export * from './trace';
|
|
15
|
+
export declare type Pipe<M = any, N = any> = (msg: M, resolve: Resolve<N>) => void;
|
|
16
|
+
export declare type Resolve<M> = (msg: M) => void;
|
|
17
|
+
export declare type Pipeline<M = any, N = any> = (msg: M, end?: Resolve<N>) => any;
|
|
18
|
+
export declare const createPipeline: (pipeArr: Pipe[]) => Pipeline;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Pipe } from './index';
|
|
2
|
+
import Core from '../core';
|
|
3
|
+
/**
|
|
4
|
+
* 上报
|
|
5
|
+
* @param aegis 实例
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export declare const reportPipe: (aegis: Core) => Pipe;
|
|
9
|
+
export declare const reportEventPipe: (aegis: Core) => Pipe;
|
|
10
|
+
export declare const reportCustomPipe: (aegis: Core) => Pipe;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface SWOptions {
|
|
2
|
+
host: string;
|
|
3
|
+
pathname: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type TraceType = 'traceparent' | 'b3' | 'sw8' | 'sentry-trace';
|
|
6
|
+
/**
|
|
7
|
+
* 根据用户配置的参数构建 trace 协议
|
|
8
|
+
* 目前适配 opentelemetry,skywalking,sentry-trace,b3协议,后续可以自由扩展
|
|
9
|
+
*/
|
|
10
|
+
export declare class TraceRequestHeader {
|
|
11
|
+
private traceType;
|
|
12
|
+
private traceId;
|
|
13
|
+
private ignoreUrls;
|
|
14
|
+
private urls;
|
|
15
|
+
private url;
|
|
16
|
+
private traceFlag;
|
|
17
|
+
constructor(traceType: TraceType, ignoreUrls: Array<string | RegExp>, urls?: Array<string | RegExp> | null, traceFlag?: boolean | number | unknown);
|
|
18
|
+
generate(url: string, headers?: HeadersInit | any, options?: SWOptions): {
|
|
19
|
+
name: TraceType;
|
|
20
|
+
value: string;
|
|
21
|
+
} | undefined;
|
|
22
|
+
private createTraceparent;
|
|
23
|
+
private createB3;
|
|
24
|
+
private createSw8;
|
|
25
|
+
private createSentryTrace;
|
|
26
|
+
private isUrlIgnored;
|
|
27
|
+
private isUrlInTraceUrls;
|
|
28
|
+
private urlMatches;
|
|
29
|
+
}
|
|
30
|
+
export declare const isTraceHeader: (key: string) => boolean;
|
|
31
|
+
export declare const parseNormalTraceRequestHeader: (headers: HeadersInit | undefined) => string;
|
|
32
|
+
export * from './jwt';
|
|
33
|
+
export * from './ot-js';
|
|
34
|
+
export * from './uuid';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* btoa 方法兼容,解决小程序不支持 btoa 的问题
|
|
3
|
+
* @param str
|
|
4
|
+
* @returns
|
|
5
|
+
*/
|
|
6
|
+
export declare const btoaPolyfill: (str: string) => string;
|
|
7
|
+
/**
|
|
8
|
+
* atob 方法兼容,解决小程序不支持 atob 的问题
|
|
9
|
+
* @param str
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const atobPolyfill: (str: string) => string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const RandomIdGenerator: {
|
|
2
|
+
/**
|
|
3
|
+
* 生成 traceId
|
|
4
|
+
* Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex
|
|
5
|
+
* characters corresponding to 128 bits.
|
|
6
|
+
*/
|
|
7
|
+
generateTraceId: () => string;
|
|
8
|
+
/**
|
|
9
|
+
* 生成 spanId
|
|
10
|
+
* Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex
|
|
11
|
+
* characters corresponding to 64 bits.
|
|
12
|
+
*/
|
|
13
|
+
generateSpanId: () => string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Pipe } from './index';
|
|
2
|
+
import Core from '../core';
|
|
3
|
+
/**
|
|
4
|
+
* 白名单请求的 pipeline
|
|
5
|
+
* 白名单接口主要有三个作用
|
|
6
|
+
* 1. 判断当前用户是否是白名单
|
|
7
|
+
* 2. 获取当前应用的抽样率
|
|
8
|
+
* 3. 判断当前上报是否合法(参数不对,上报id不对,当前应用已经停止上报,用户欠费等)
|
|
9
|
+
* @param aegis
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare const createWhitelistPipe: (aegis: Core) => Pipe;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Core from './core';
|
|
2
|
+
declare type PluginConfig = boolean | any;
|
|
3
|
+
interface PluginOption<Aegis> {
|
|
4
|
+
name: string;
|
|
5
|
+
init?: (this: PluginOption<Aegis> & PluginMethod<Aegis>, config: PluginConfig) => void;
|
|
6
|
+
onNewAegis?: (this: PluginOption<Aegis> & PluginMethod<Aegis>, aegis: Aegis, option: PluginConfig) => void;
|
|
7
|
+
destroy?: Function;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
interface PluginMethod<Aegis> {
|
|
11
|
+
$walk: (cb: (aegis: Aegis, config: PluginConfig) => void) => void;
|
|
12
|
+
$getConfig: (aegis: Aegis) => PluginConfig;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export default class Plugin<Aegis = Core> {
|
|
16
|
+
aegisPlugin: boolean;
|
|
17
|
+
name: string;
|
|
18
|
+
option: PluginOption<Aegis>;
|
|
19
|
+
private instances;
|
|
20
|
+
private inited;
|
|
21
|
+
constructor(option: PluginOption<Aegis>);
|
|
22
|
+
patch(aegis: Aegis): void;
|
|
23
|
+
unpatch(aegis: Aegis): void;
|
|
24
|
+
countInstance(): number;
|
|
25
|
+
uninstall(aegis: Aegis): void;
|
|
26
|
+
private walk;
|
|
27
|
+
private canUse;
|
|
28
|
+
private getConfig;
|
|
29
|
+
private exist;
|
|
30
|
+
private triggerInit;
|
|
31
|
+
private triggerOnNewAegis;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface InterfaceEventEmitter {
|
|
2
|
+
indexOf: Function;
|
|
3
|
+
on: Function;
|
|
4
|
+
one: Function;
|
|
5
|
+
emit: Function;
|
|
6
|
+
remove: Function;
|
|
7
|
+
clear: Function;
|
|
8
|
+
}
|
|
9
|
+
export declare class EventEmitter {
|
|
10
|
+
private eventsList;
|
|
11
|
+
constructor();
|
|
12
|
+
indexOf(array: any[], value: any): number;
|
|
13
|
+
on(name: string, callback: Function, type?: number): this | undefined;
|
|
14
|
+
one(name: string, callback: Function): void;
|
|
15
|
+
emit: (name: string, data: any) => this | undefined;
|
|
16
|
+
remove(name: string, callback: Function): this | null | undefined;
|
|
17
|
+
clear(): void;
|
|
18
|
+
}
|