@tencent-rtc/mcp 1.0.9 → 1.1.6
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/README.md +5 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/libs/TLSSigAPIv2.d.ts +134 -0
- package/libs/TLSSigAPIv2.js +243 -0
- package/package.json +1 -1
- package/resource/doc/chatuikit/react/chat_window_integration.md +92 -0
- package/resource/doc/chatuikit/react/integration.md +14 -10
- package/resource/doc/chatuikit/vue/chat_window_integration.md +155 -0
- package/resource/doc/chatuikit/vue/components/chat.md +8 -0
- package/resource/doc/chatuikit/vue/components/chatheader.md +1 -1
- package/resource/doc/chatuikit/vue/components/conversation-list.md +5 -0
- package/resource/doc/chatuikit/vue/components/message-input.md +4 -1
- package/resource/doc/chatuikit/vue/init.md +40 -0
- package/resource/doc/chatuikit/vue/integration.md +34 -74
- package/resource/doc/livekit/vue/components/barrage.md +616 -0
- package/resource/doc/livekit/vue/components/broadcast.md +595 -0
- package/resource/doc/livekit/vue/components/co-guest-panel.md +130 -0
- package/resource/doc/livekit/vue/components/live-audience-list.md +282 -0
- package/resource/doc/livekit/vue/components/live-list.md +200 -0
- package/resource/doc/livekit/vue/components/live-player.md +269 -0
- package/resource/doc/livekit/vue/components/live-scene-panel.md +175 -0
- package/resource/doc/livekit/vue/components/live-view.md +398 -0
- package/resource/doc/livekit/vue/components/stream-mixer.md +446 -0
- package/resource/doc/livekit/vue/states/live-state.md +3591 -0
- package/resource/doc/roomkit/vue/states/device-state.md +369 -0
- package/resource/doc/roomkit/vue/states/login-state.md +59 -0
- package/resource/doc/roomkit/vue/states/room-list-state.md +355 -0
- package/resource/doc/roomkit/vue/states/room-participant-state.md +388 -0
- package/server-config.js +35 -0
- package/server-config.js.map +1 -0
- package/tools/chat/get-chat-faq.js +3 -3
- package/tools/chat/get-chat-faq.js.map +1 -1
- package/tools/chat/get-native-chat-integration.js +4 -4
- package/tools/chat/get-web-chat-component-detail.js +4 -3
- package/tools/chat/get-web-chat-component-detail.js.map +1 -1
- package/tools/chat/get-web-chat-integration.js +9 -9
- package/tools/chat/get-web-chat-integration.js.map +1 -1
- package/tools/chat/{get-web-chat-uikit-login.js → get-web-chat-uikit-init.js} +7 -7
- package/tools/chat/get-web-chat-uikit-init.js.map +1 -0
- package/tools/chat/get-web-chat-window-integration.js +37 -0
- package/tools/chat/get-web-chat-window-integration.js.map +1 -0
- package/tools/common/get-usersig.js +31 -26
- package/tools/common/get-usersig.js.map +1 -1
- package/tools/common/present-framework-choice.js +1 -1
- package/tools/common/record-prompt.js +5 -5
- package/tools/common/record-result.js +8 -7
- package/tools/common/record-result.js.map +1 -1
- package/tools/index.js +24 -9
- package/tools/index.js.map +1 -1
- package/tools/live/get-web-live-component-detail.js +34 -0
- package/tools/live/get-web-live-component-detail.js.map +1 -0
- package/tools/live/get-web-live-state-detail.js +34 -0
- package/tools/live/get-web-live-state-detail.js.map +1 -0
- package/tools/room/get-web-room-state-detail.js +34 -0
- package/tools/room/get-web-room-state-detail.js.map +1 -0
- package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js +35 -0
- package/tools/rtcengine/get-rtcengine-web-sdk-integration-guide.js.map +1 -0
- package/tools/rtcengine/{get-rtcenigne-faq.js → get-trtc-web-sdk-faq.js} +5 -5
- package/tools/rtcengine/get-trtc-web-sdk-faq.js.map +1 -0
- package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js +36 -0
- package/tools/rtcengine/get-trtc-web-sdk-integration-guide.js.map +1 -0
- package/utils/generate-usersig.js +7 -9
- package/utils/generate-usersig.js.map +1 -1
- package/utils/handle-component-name.js +53 -8
- package/utils/handle-component-name.js.map +1 -1
- package/utils/handle-state-name.js +29 -0
- package/utils/handle-state-name.js.map +1 -0
- package/@tencent/aegis-node-sdk/CHANGELOG.md +0 -8
- package/@tencent/aegis-node-sdk/LICENSE +0 -21
- package/@tencent/aegis-node-sdk/README.md +0 -562
- package/@tencent/aegis-node-sdk/lib/aegis.min.js +0 -1
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +0 -14
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +0 -1
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +0 -85
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +0 -9
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +0 -62
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +0 -11
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +0 -4
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +0 -130
- package/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +0 -34
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +0 -8
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +0 -8
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +0 -4
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +0 -10
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +0 -34
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +0 -14
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +0 -3
- package/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +0 -33
- 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 +0 -2
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +0 -60
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +0 -15
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +0 -5
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +0 -6
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +0 -18
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +0 -12
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +0 -10
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +0 -20
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +0 -27
- package/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +0 -2
- package/@tencent/aegis-node-sdk/package.json +0 -19
- package/@tencent/polaris/README.md +0 -407
- package/@tencent/polaris/dist/consumer/health.d.ts +0 -126
- package/@tencent/polaris/dist/consumer/health.js +0 -283
- package/@tencent/polaris/dist/consumer/health.js.map +0 -1
- package/@tencent/polaris/dist/consumer/index.d.ts +0 -120
- package/@tencent/polaris/dist/consumer/index.js +0 -348
- package/@tencent/polaris/dist/consumer/index.js.map +0 -1
- package/@tencent/polaris/dist/consumer/monitor.d.ts +0 -145
- package/@tencent/polaris/dist/consumer/monitor.js +0 -343
- package/@tencent/polaris/dist/consumer/monitor.js.map +0 -1
- package/@tencent/polaris/dist/consumer/selector.d.ts +0 -73
- package/@tencent/polaris/dist/consumer/selector.js +0 -316
- package/@tencent/polaris/dist/consumer/selector.js.map +0 -1
- package/@tencent/polaris/dist/errors.d.ts +0 -373
- package/@tencent/polaris/dist/errors.js +0 -154
- package/@tencent/polaris/dist/errors.js.map +0 -1
- package/@tencent/polaris/dist/global.d.ts +0 -16
- package/@tencent/polaris/dist/global.js +0 -18
- package/@tencent/polaris/dist/global.js.map +0 -1
- package/@tencent/polaris/dist/index.d.ts +0 -62
- package/@tencent/polaris/dist/index.js +0 -145
- package/@tencent/polaris/dist/index.js.map +0 -1
- package/@tencent/polaris/dist/instance.d.ts +0 -109
- package/@tencent/polaris/dist/instance.js +0 -38
- package/@tencent/polaris/dist/instance.js.map +0 -1
- package/@tencent/polaris/dist/limiter/bucket.d.ts +0 -51
- package/@tencent/polaris/dist/limiter/bucket.js +0 -152
- package/@tencent/polaris/dist/limiter/bucket.js.map +0 -1
- package/@tencent/polaris/dist/limiter/index.d.ts +0 -73
- package/@tencent/polaris/dist/limiter/index.js +0 -149
- package/@tencent/polaris/dist/limiter/index.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimit.d.ts +0 -27
- package/@tencent/polaris/dist/limiter/ratelimit.js +0 -134
- package/@tencent/polaris/dist/limiter/ratelimit.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +0 -17
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js +0 -15
- package/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +0 -59
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js +0 -397
- package/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +0 -3
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js +0 -19
- package/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +0 -1
- package/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +0 -17
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js +0 -52
- package/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +0 -1
- package/@tencent/polaris/dist/location.d.ts +0 -48
- package/@tencent/polaris/dist/location.js +0 -67
- package/@tencent/polaris/dist/location.js.map +0 -1
- package/@tencent/polaris/dist/logging.d.ts +0 -106
- package/@tencent/polaris/dist/logging.js +0 -130
- package/@tencent/polaris/dist/logging.js.map +0 -1
- package/@tencent/polaris/dist/metadata.d.ts +0 -78
- package/@tencent/polaris/dist/metadata.js +0 -119
- package/@tencent/polaris/dist/metadata.js.map +0 -1
- package/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +0 -47
- package/@tencent/polaris/dist/plugins/breaker/polaris.js +0 -162
- package/@tencent/polaris/dist/plugins/breaker/polaris.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/base.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/base.js +0 -32
- package/@tencent/polaris/dist/plugins/lb/base.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/edf.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/edf.js +0 -77
- package/@tencent/polaris/dist/plugins/lb/edf.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/hashring.d.ts +0 -24
- package/@tencent/polaris/dist/plugins/lb/hashring.js +0 -53
- package/@tencent/polaris/dist/plugins/lb/hashring.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/sticky.d.ts +0 -31
- package/@tencent/polaris/dist/plugins/lb/sticky.js +0 -88
- package/@tencent/polaris/dist/plugins/lb/sticky.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/swrr.d.ts +0 -25
- package/@tencent/polaris/dist/plugins/lb/swrr.js +0 -72
- package/@tencent/polaris/dist/plugins/lb/swrr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/wr.d.ts +0 -17
- package/@tencent/polaris/dist/plugins/lb/wr.js +0 -50
- package/@tencent/polaris/dist/plugins/lb/wr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/lb/wrr.d.ts +0 -19
- package/@tencent/polaris/dist/plugins/lb/wrr.js +0 -81
- package/@tencent/polaris/dist/plugins/lb/wrr.js.map +0 -1
- package/@tencent/polaris/dist/plugins/logging/console.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/logging/console.js +0 -38
- package/@tencent/polaris/dist/plugins/logging/console.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +0 -32
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js +0 -88
- package/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +0 -124
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +0 -398
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +0 -27
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +0 -287
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +0 -15
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +0 -43
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +0 -249
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +0 -19
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +0 -222
- package/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +0 -26
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +0 -99
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +0 -60
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +0 -259
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +0 -24
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +0 -12
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +0 -39
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +0 -115
- package/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +0 -24
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +0 -22
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +0 -80
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +0 -65
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +0 -66
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +0 -95
- package/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +0 -1568
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +0 -36
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +0 -51
- package/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +0 -18
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +0 -82
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +0 -11
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +0 -46
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +0 -16
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +0 -10
- package/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +0 -1102
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +0 -29
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +0 -77
- package/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +0 -12
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +0 -28
- package/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +0 -395
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +0 -13
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +0 -116
- package/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +0 -67
- package/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +0 -1
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +0 -99
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +0 -217
- package/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +0 -1
- package/@tencent/polaris/dist/plugins/registry/memory.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/registry/memory.js +0 -50
- package/@tencent/polaris/dist/plugins/registry/memory.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +0 -51
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js +0 -145
- package/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +0 -11
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js +0 -174
- package/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +0 -25
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js +0 -36
- package/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +0 -10
- package/@tencent/polaris/dist/plugins/router/trpc/env.js +0 -34
- package/@tencent/polaris/dist/plugins/router/trpc/env.js.map +0 -1
- package/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +0 -56
- package/@tencent/polaris/dist/plugins/router/trpc/set.js +0 -106
- package/@tencent/polaris/dist/plugins/router/trpc/set.js.map +0 -1
- package/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +0 -31
- package/@tencent/polaris/dist/plugins/shaping/unirate.js +0 -124
- package/@tencent/polaris/dist/plugins/shaping/unirate.js.map +0 -1
- package/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +0 -61
- package/@tencent/polaris/dist/plugins/shaping/warmup.js +0 -171
- package/@tencent/polaris/dist/plugins/shaping/warmup.js.map +0 -1
- package/@tencent/polaris/dist/plugins/weight/polaris.d.ts +0 -23
- package/@tencent/polaris/dist/plugins/weight/polaris.js +0 -159
- package/@tencent/polaris/dist/plugins/weight/polaris.js.map +0 -1
- package/@tencent/polaris/dist/plugins.d.ts +0 -619
- package/@tencent/polaris/dist/plugins.js +0 -91
- package/@tencent/polaris/dist/plugins.js.map +0 -1
- package/@tencent/polaris/dist/polaris.d.ts +0 -33
- package/@tencent/polaris/dist/polaris.js +0 -59
- package/@tencent/polaris/dist/polaris.js.map +0 -1
- package/@tencent/polaris/dist/provider/index.d.ts +0 -102
- package/@tencent/polaris/dist/provider/index.js +0 -168
- package/@tencent/polaris/dist/provider/index.js.map +0 -1
- package/@tencent/polaris/dist/registry.d.ts +0 -174
- package/@tencent/polaris/dist/registry.js +0 -660
- package/@tencent/polaris/dist/registry.js.map +0 -1
- package/@tencent/polaris/dist/rules.d.ts +0 -163
- package/@tencent/polaris/dist/rules.js +0 -24
- package/@tencent/polaris/dist/rules.js.map +0 -1
- package/@tencent/polaris/dist/scripts/postinstall.d.ts +0 -1
- package/@tencent/polaris/dist/scripts/postinstall.js +0 -71
- package/@tencent/polaris/dist/scripts/postinstall.js.map +0 -1
- package/@tencent/polaris/dist/service.d.ts +0 -18
- package/@tencent/polaris/dist/service.js +0 -3
- package/@tencent/polaris/dist/service.js.map +0 -1
- package/@tencent/polaris/dist/skeleton.d.ts +0 -87
- package/@tencent/polaris/dist/skeleton.js +0 -282
- package/@tencent/polaris/dist/skeleton.js.map +0 -1
- package/@tencent/polaris/dist/utils.d.ts +0 -36
- package/@tencent/polaris/dist/utils.js +0 -74
- package/@tencent/polaris/dist/utils.js.map +0 -1
- package/@tencent/polaris/dist/weak.d.ts +0 -11
- package/@tencent/polaris/dist/weak.js +0 -44
- package/@tencent/polaris/dist/weak.js.map +0 -1
- package/@tencent/polaris/package.json +0 -114
- package/libs/lib-generate-test-usersig-es.min.d.ts +0 -6
- package/libs/lib-generate-test-usersig-es.min.js +0 -2
- package/resource/doc/chatuikit/react/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/react/integrate_tuichat_only_react.md +0 -202
- package/resource/doc/chatuikit/react/integrate_tuichat_react.md +0 -279
- package/resource/doc/chatuikit/vue/generate_UserSig.md +0 -306
- package/resource/doc/chatuikit/vue/integrate_only_tuichat_Vue_web.md +0 -124
- package/resource/doc/chatuikit/vue/integrate_tuikit_Vue_web.md +0 -552
- package/resource/doc/chatuikit/vue/login.md +0 -31
- package/resource/doc/chatuikit/vue3/components/MessageInput.md +0 -1272
- package/resource/doc/chatuikit/vue3/components/avatar.md +0 -137
- package/resource/doc/chatuikit/vue3/components/chatheader.md +0 -189
- package/resource/doc/chatuikit/vue3/components/component-list.md +0 -102
- package/resource/doc/chatuikit/vue3/components/userpicker.md +0 -315
- package/resource/doc/chatuikit/vue3/integration.md +0 -256
- package/streamableHttp.js +0 -74
- package/streamableHttp.js.map +0 -1
- package/tools/call/get-native-call-integration-guide.js +0 -36
- package/tools/call/get-native-call-integration-guide.js.map +0 -1
- package/tools/call/get-web-call-integration-guide.js +0 -35
- package/tools/call/get-web-call-integration-guide.js.map +0 -1
- package/tools/chat/get-native-chat-integration-guide.js +0 -34
- package/tools/chat/get-native-chat-integration-guide.js.map +0 -1
- package/tools/chat/get-web-chat-integration-guide.js +0 -35
- package/tools/chat/get-web-chat-integration-guide.js.map +0 -1
- package/tools/chat/get-web-chat-uikit-login.js.map +0 -1
- package/tools/rtcengine/get-rtcengine-integration-guide.js +0 -33
- package/tools/rtcengine/get-rtcengine-integration-guide.js.map +0 -1
- package/tools/rtcengine/get-rtcenigne-faq.js.map +0 -1
- /package/resource/doc/chatuikit/react/{login.md → init.md} +0 -0
package/README.md
CHANGED
|
@@ -44,7 +44,11 @@ npx -y @tencent-rtc/mcp
|
|
|
44
44
|
"mcpServers": {
|
|
45
45
|
"tencent-rtc": {
|
|
46
46
|
"command": "npx",
|
|
47
|
-
"args": ["-y", "@tencent-rtc/mcp"]
|
|
47
|
+
"args": ["-y", "@tencent-rtc/mcp"],
|
|
48
|
+
"env": {
|
|
49
|
+
"SDKAPPID": "YOUR_SDKAPPID",
|
|
50
|
+
"SECRETKEY": "YOUR_SECRET_KEY"
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
}
|
package/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { createServer } from './server.js';
|
|
4
|
+
import { ServerConfig } from './server-config.js';
|
|
4
5
|
// 启动服务器
|
|
5
6
|
async function main() {
|
|
7
|
+
ServerConfig.getInstance();
|
|
6
8
|
const server = createServer();
|
|
7
9
|
const transport = new StdioServerTransport();
|
|
8
10
|
await server.connect(transport);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,QAAQ;AACR,KAAK,UAAU,IAAI;IACjB,YAAY,CAAC,WAAW,EAAE,CAAC;IAC3B,MAAM,MAAM,GAAc,YAAY,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAC5D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TLSSigAPIv2 TypeScript 声明文件
|
|
3
|
+
* 用于腾讯云实时音视频(TRTC)和即时通信(IM)服务的签名生成
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* TLS签名API类
|
|
8
|
+
*/
|
|
9
|
+
export declare class Api {
|
|
10
|
+
/**
|
|
11
|
+
* 构造函数
|
|
12
|
+
* @param sdkappid - 应用的SDKAppID
|
|
13
|
+
* @param key - 应用的密钥
|
|
14
|
+
*/
|
|
15
|
+
constructor(sdkappid: number, key: string);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* SDKAppID
|
|
19
|
+
*/
|
|
20
|
+
readonly sdkappid: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 应用密钥
|
|
24
|
+
*/
|
|
25
|
+
readonly key: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 生成UserSig签名
|
|
29
|
+
* 用于签发 TRTC 和 IM 服务中必须要使用的 UserSig 鉴权票据
|
|
30
|
+
*
|
|
31
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符
|
|
32
|
+
* @param expire - UserSig 票据的过期时间,单位是秒,比如 86400 代表生成的 UserSig 票据在一天后就无法再使用了
|
|
33
|
+
* @returns 返回生成的UserSig字符串
|
|
34
|
+
*/
|
|
35
|
+
genUserSig(userid: string, expire: number): string;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 生成PrivateMapKey权限票据(数字房间号)
|
|
39
|
+
* 用于签发 TRTC 进房参数中可选的 PrivateMapKey 权限票据
|
|
40
|
+
*
|
|
41
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符
|
|
42
|
+
* @param expire - PrivateMapKey 票据的过期时间,单位是秒
|
|
43
|
+
* @param roomid - 房间号,用于指定该 userid 可以进入的房间号
|
|
44
|
+
* @param privilegeMap - 权限位,使用了一个字节中的 8 个比特位,分别代表八个具体的功能权限开关
|
|
45
|
+
* @returns 返回生成的PrivateMapKey字符串
|
|
46
|
+
*/
|
|
47
|
+
genPrivateMapKey(userid: string, expire: number, roomid: number, privilegeMap: number): string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 生成PrivateMapKey权限票据(字符串房间号)
|
|
51
|
+
* 用于签发 TRTC 进房参数中可选的 PrivateMapKey 权限票据
|
|
52
|
+
*
|
|
53
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符
|
|
54
|
+
* @param expire - PrivateMapKey 票据的过期时间,单位是秒
|
|
55
|
+
* @param roomstr - 字符串房间号,用于指定该 userid 可以进入的房间号
|
|
56
|
+
* @param privilegeMap - 权限位,使用了一个字节中的 8 个比特位,分别代表八个具体的功能权限开关
|
|
57
|
+
* @returns 返回生成的PrivateMapKey字符串
|
|
58
|
+
*/
|
|
59
|
+
genPrivateMapKeyWithStringRoomID(userid: string, expire: number, roomstr: string, privilegeMap: number): string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 通用签名生成方法
|
|
63
|
+
* @param userid - 用户ID
|
|
64
|
+
* @param expire - 过期时间(秒)
|
|
65
|
+
* @param userBuf - 用户缓冲区数据,可选
|
|
66
|
+
* @returns 返回生成的签名字符串
|
|
67
|
+
*/
|
|
68
|
+
genSig(userid: string, expire: number, userBuf?: Buffer | null): string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 生成HMAC-SHA256签名(私有方法)
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
private _hmacsha256(identifier: string, currTime: number, expire: number, base64UserBuf?: string | null): string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 生成用户缓冲区数据(私有方法)
|
|
78
|
+
* @private
|
|
79
|
+
*/
|
|
80
|
+
private _genUserbuf(
|
|
81
|
+
account: string,
|
|
82
|
+
dwAuthID: number,
|
|
83
|
+
dwExpTime: number,
|
|
84
|
+
dwPrivilegeMap: number,
|
|
85
|
+
dwAccountType: number,
|
|
86
|
+
roomstr?: string | null
|
|
87
|
+
): Buffer;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 权限位常量定义
|
|
92
|
+
* 使用了一个字节中的 8 个比特位,分别代表八个具体的功能权限开关
|
|
93
|
+
*/
|
|
94
|
+
export declare namespace PrivilegeMap {
|
|
95
|
+
/** 创建房间的权限 */
|
|
96
|
+
const CREATE_ROOM = 1;
|
|
97
|
+
/** 加入房间的权限 */
|
|
98
|
+
const JOIN_ROOM = 2;
|
|
99
|
+
/** 发送语音的权限 */
|
|
100
|
+
const SEND_AUDIO = 4;
|
|
101
|
+
/** 接收语音的权限 */
|
|
102
|
+
const RECEIVE_AUDIO = 8;
|
|
103
|
+
/** 发送视频的权限 */
|
|
104
|
+
const SEND_VIDEO = 16;
|
|
105
|
+
/** 接收视频的权限 */
|
|
106
|
+
const RECEIVE_VIDEO = 32;
|
|
107
|
+
/** 发送辅路(屏幕分享)视频的权限 */
|
|
108
|
+
const SEND_SUB_VIDEO = 64;
|
|
109
|
+
/** 接收辅路(屏幕分享)视频的权限 */
|
|
110
|
+
const RECEIVE_SUB_VIDEO = 128;
|
|
111
|
+
/** 所有权限 */
|
|
112
|
+
const ALL_PRIVILEGES = 255;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 使用示例:
|
|
117
|
+
*
|
|
118
|
+
* ```typescript
|
|
119
|
+
* import { Api } from './TLSSigAPIv2';
|
|
120
|
+
* // 或者使用 CommonJS 方式:
|
|
121
|
+
* // const { Api } = require('./TLSSigAPIv2');
|
|
122
|
+
*
|
|
123
|
+
* const api = new Api(1400000000, 'your-secret-key');
|
|
124
|
+
*
|
|
125
|
+
* // 生成UserSig
|
|
126
|
+
* const userSig = api.genUserSig('user123', 86400);
|
|
127
|
+
*
|
|
128
|
+
* // 生成PrivateMapKey(数字房间号)
|
|
129
|
+
* const privateMapKey = api.genPrivateMapKey('user123', 86400, 12345, 255);
|
|
130
|
+
*
|
|
131
|
+
* // 生成PrivateMapKey(字符串房间号)
|
|
132
|
+
* const privateMapKeyStr = api.genPrivateMapKeyWithStringRoomID('user123', 86400, 'room_abc', 255);
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import zlib from 'zlib';
|
|
3
|
+
|
|
4
|
+
var base64url = {};
|
|
5
|
+
|
|
6
|
+
var newBuffer = function (fill, encoding) {
|
|
7
|
+
return Buffer.from ? Buffer.from(fill, encoding) : new Buffer(fill, encoding)
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
base64url.unescape = function unescape(str) {
|
|
11
|
+
return (str + Array(5 - str.length % 4))
|
|
12
|
+
.replace(/_/g, '=')
|
|
13
|
+
.replace(/\-/g, '/')
|
|
14
|
+
.replace(/\*/g, '+');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
base64url.escape = function escape(str) {
|
|
18
|
+
return str.replace(/\+/g, '*')
|
|
19
|
+
.replace(/\//g, '-')
|
|
20
|
+
.replace(/=/g, '_');
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
base64url.encode = function encode(str) {
|
|
24
|
+
return this.escape(newBuffer(str).toString('base64'));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
base64url.decode = function decode(str) {
|
|
28
|
+
return newBuffer(this.unescape(str), 'base64').toString();
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function base64encode(str) {
|
|
32
|
+
return newBuffer(str).toString('base64')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function base64decode(str) {
|
|
36
|
+
return newBuffer(str, 'base64').toString()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var Api = function (sdkappid, key) {
|
|
40
|
+
this.sdkappid = sdkappid;
|
|
41
|
+
this.key = key;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* 通过传入参数生成 base64 的 hmac 值
|
|
45
|
+
* @param identifier
|
|
46
|
+
* @param currTime
|
|
47
|
+
* @param expire
|
|
48
|
+
* @returns {string}
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
Api.prototype._hmacsha256 = function (identifier, currTime, expire, base64UserBuf) {
|
|
52
|
+
var contentToBeSigned = "TLS.identifier:" + identifier + "\n";
|
|
53
|
+
contentToBeSigned += "TLS.sdkappid:" + this.sdkappid + "\n";
|
|
54
|
+
contentToBeSigned += "TLS.time:" + currTime + "\n";
|
|
55
|
+
contentToBeSigned += "TLS.expire:" + expire + "\n";
|
|
56
|
+
if (null != base64UserBuf) {
|
|
57
|
+
contentToBeSigned += "TLS.userbuf:" + base64UserBuf + "\n";
|
|
58
|
+
}
|
|
59
|
+
const hmac = crypto.createHmac("sha256", this.key);
|
|
60
|
+
return hmac.update(contentToBeSigned).digest('base64');
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* TRTC业务进房权限加密串需使用用户定义的userbuf
|
|
64
|
+
* @brief 生成 userbuf
|
|
65
|
+
* @param account 用户名
|
|
66
|
+
* @param dwSdkappid sdkappid
|
|
67
|
+
* @param dwAuthID 数字房间号
|
|
68
|
+
* @param dwExpTime 过期时间:该权限加密串的过期时间,建议300秒,实际过期时间:now+dwExpTime
|
|
69
|
+
* @param dwPrivilegeMap 用户权限,255表示所有权限
|
|
70
|
+
* @param dwAccountType 用户类型,默认为0
|
|
71
|
+
* @param roomstr 字符串房间号
|
|
72
|
+
* @return userbuf {string} 返回的userbuf
|
|
73
|
+
*/
|
|
74
|
+
Api.prototype._genUserbuf = function (account, dwAuthID, dwExpTime,
|
|
75
|
+
dwPrivilegeMap, dwAccountType, roomstr) {
|
|
76
|
+
|
|
77
|
+
let accountLength = account.length;
|
|
78
|
+
let roomstrlength = 0;
|
|
79
|
+
let length = 1 + 2 + accountLength + 20 ;
|
|
80
|
+
if (null != roomstr)
|
|
81
|
+
{
|
|
82
|
+
roomstrlength = roomstr.length;
|
|
83
|
+
length = length + 2 + roomstrlength;
|
|
84
|
+
}
|
|
85
|
+
let offset = 0;
|
|
86
|
+
let userBuf = new Buffer.alloc(length);
|
|
87
|
+
|
|
88
|
+
//cVer
|
|
89
|
+
if (null != roomstr)
|
|
90
|
+
userBuf[offset++] = 1;
|
|
91
|
+
else
|
|
92
|
+
userBuf[offset++] = 0;
|
|
93
|
+
|
|
94
|
+
//wAccountLen
|
|
95
|
+
userBuf[offset++] = (accountLength & 0xFF00) >> 8;
|
|
96
|
+
userBuf[offset++] = accountLength & 0x00FF;
|
|
97
|
+
|
|
98
|
+
//buffAccount
|
|
99
|
+
for (; offset < 3 + accountLength; ++offset) {
|
|
100
|
+
userBuf[offset] = account.charCodeAt(offset - 3);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//dwSdkAppid
|
|
104
|
+
userBuf[offset++] = (this.sdkappid & 0xFF000000) >> 24;
|
|
105
|
+
userBuf[offset++] = (this.sdkappid & 0x00FF0000) >> 16;
|
|
106
|
+
userBuf[offset++] = (this.sdkappid & 0x0000FF00) >> 8;
|
|
107
|
+
userBuf[offset++] = this.sdkappid & 0x000000FF;
|
|
108
|
+
|
|
109
|
+
//dwAuthId
|
|
110
|
+
userBuf[offset++] = (dwAuthID & 0xFF000000) >> 24;
|
|
111
|
+
userBuf[offset++] = (dwAuthID & 0x00FF0000) >> 16;
|
|
112
|
+
userBuf[offset++] = (dwAuthID & 0x0000FF00) >> 8;
|
|
113
|
+
userBuf[offset++] = dwAuthID & 0x000000FF;
|
|
114
|
+
|
|
115
|
+
//过期时间:dwExpTime+now
|
|
116
|
+
let expire = Date.now() / 1000 + dwExpTime;
|
|
117
|
+
userBuf[offset++] = (expire & 0xFF000000) >> 24;
|
|
118
|
+
userBuf[offset++] = (expire & 0x00FF0000) >> 16;
|
|
119
|
+
userBuf[offset++] = (expire & 0x0000FF00) >> 8;
|
|
120
|
+
userBuf[offset++] = expire & 0x000000FF;
|
|
121
|
+
|
|
122
|
+
//dwPrivilegeMap
|
|
123
|
+
userBuf[offset++] = (dwPrivilegeMap & 0xFF000000) >> 24;
|
|
124
|
+
userBuf[offset++] = (dwPrivilegeMap & 0x00FF0000) >> 16;
|
|
125
|
+
userBuf[offset++] = (dwPrivilegeMap & 0x0000FF00) >> 8;
|
|
126
|
+
userBuf[offset++] = dwPrivilegeMap & 0x000000FF;
|
|
127
|
+
|
|
128
|
+
//dwAccountType
|
|
129
|
+
userBuf[offset++] = (dwAccountType & 0xFF000000) >> 24;
|
|
130
|
+
userBuf[offset++] = (dwAccountType & 0x00FF0000) >> 16;
|
|
131
|
+
userBuf[offset++] = (dwAccountType & 0x0000FF00) >> 8;
|
|
132
|
+
userBuf[offset++] = dwAccountType & 0x000000FF;
|
|
133
|
+
|
|
134
|
+
if (null != roomstr) {
|
|
135
|
+
//roomstrlength
|
|
136
|
+
userBuf[offset++] = (roomstr.length & 0xFF00) >> 8;
|
|
137
|
+
userBuf[offset++] = roomstr.length & 0x00FF;
|
|
138
|
+
|
|
139
|
+
//roomstr
|
|
140
|
+
for (; offset < length; ++offset) {
|
|
141
|
+
userBuf[offset] = roomstr.charCodeAt(offset - (length - roomstr.length));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return userBuf;
|
|
146
|
+
}
|
|
147
|
+
Api.prototype.genSig = function (userid, expire, userBuf) {
|
|
148
|
+
var currTime = Math.floor(Date.now() / 1000);
|
|
149
|
+
|
|
150
|
+
var sigDoc = {
|
|
151
|
+
'TLS.ver': "2.0",
|
|
152
|
+
'TLS.identifier': "" + userid,
|
|
153
|
+
'TLS.sdkappid': Number(this.sdkappid),
|
|
154
|
+
'TLS.time': Number(currTime),
|
|
155
|
+
'TLS.expire': Number(expire)
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
var sig = '';
|
|
159
|
+
if (null != userBuf) {
|
|
160
|
+
var base64UserBuf = base64encode(userBuf);
|
|
161
|
+
sigDoc['TLS.userbuf'] = base64UserBuf;
|
|
162
|
+
sig = this._hmacsha256(userid, currTime, expire, base64UserBuf);
|
|
163
|
+
} else {
|
|
164
|
+
sig = this._hmacsha256(userid, currTime, expire, null);
|
|
165
|
+
}
|
|
166
|
+
sigDoc['TLS.sig'] = sig;
|
|
167
|
+
|
|
168
|
+
var compressed = zlib.deflateSync(newBuffer(JSON.stringify(sigDoc))).toString('base64');
|
|
169
|
+
return base64url.escape(compressed);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
*【功能说明】用于签发 TRTC 和 IM 服务中必须要使用的 UserSig 鉴权票据
|
|
173
|
+
*
|
|
174
|
+
*【参数说明】
|
|
175
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符。
|
|
176
|
+
* @param expire - UserSig 票据的过期时间,单位是秒,比如 86400 代表生成的 UserSig 票据在一天后就无法再使用了。
|
|
177
|
+
*/
|
|
178
|
+
Api.prototype.genUserSig = function (userid, expire) {
|
|
179
|
+
return this.genSig(userid, expire, null);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
*【功能说明】
|
|
184
|
+
* 用于签发 TRTC 进房参数中可选的 PrivateMapKey 权限票据。
|
|
185
|
+
* PrivateMapKey 需要跟 UserSig 一起使用,但 PrivateMapKey 比 UserSig 有更强的权限控制能力:
|
|
186
|
+
* - UserSig 只能控制某个 UserID 有无使用 TRTC 服务的权限,只要 UserSig 正确,其对应的 UserID 可以进出任意房间。
|
|
187
|
+
* - PrivateMapKey 则是将 UserID 的权限控制的更加严格,包括能不能进入某个房间,能不能在该房间里上行音视频等等。
|
|
188
|
+
* 如果要开启 PrivateMapKey 严格权限位校验,需要在【实时音视频控制台】=>【应用管理】=>【应用信息】中打开“启动权限密钥”开关。
|
|
189
|
+
*
|
|
190
|
+
*【参数说明】
|
|
191
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符。
|
|
192
|
+
* @param expire - PrivateMapKey 票据的过期时间,单位是秒,比如 86400 生成的 PrivateMapKey 票据在一天后就无法再使用了。
|
|
193
|
+
* @param roomid - 房间号,用于指定该 userid 可以进入的房间号
|
|
194
|
+
* @param privilegeMap - 权限位,使用了一个字节中的 8 个比特位,分别代表八个具体的功能权限开关:
|
|
195
|
+
* - 第 1 位:0000 0001 = 1,创建房间的权限
|
|
196
|
+
* - 第 2 位:0000 0010 = 2,加入房间的权限
|
|
197
|
+
* - 第 3 位:0000 0100 = 4,发送语音的权限
|
|
198
|
+
* - 第 4 位:0000 1000 = 8,接收语音的权限
|
|
199
|
+
* - 第 5 位:0001 0000 = 16,发送视频的权限
|
|
200
|
+
* - 第 6 位:0010 0000 = 32,接收视频的权限
|
|
201
|
+
* - 第 7 位:0100 0000 = 64,发送辅路(也就是屏幕分享)视频的权限
|
|
202
|
+
* - 第 8 位:1000 0000 = 200,接收辅路(也就是屏幕分享)视频的权限
|
|
203
|
+
* - privilegeMap == 1111 1111 == 255 代表该 userid 在该 roomid 房间内的所有功能权限。
|
|
204
|
+
* - privilegeMap == 0010 1010 == 42 代表该 userid 拥有加入房间和接收音视频数据的权限,但不具备其他权限。
|
|
205
|
+
*/
|
|
206
|
+
Api.prototype.genPrivateMapKey = function (userid, expire, roomid, privilegeMap) {
|
|
207
|
+
var userBuf = this._genUserbuf(userid, roomid, expire, privilegeMap, 0, null);
|
|
208
|
+
return this.genSig(userid, expire, userBuf);
|
|
209
|
+
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
*【功能说明】
|
|
213
|
+
* 用于签发 TRTC 进房参数中可选的 PrivateMapKey 权限票据。
|
|
214
|
+
* PrivateMapKey 需要跟 UserSig 一起使用,但 PrivateMapKey 比 UserSig 有更强的权限控制能力:
|
|
215
|
+
* - UserSig 只能控制某个 UserID 有无使用 TRTC 服务的权限,只要 UserSig 正确,其对应的 UserID 可以进出任意房间。
|
|
216
|
+
* - PrivateMapKey 则是将 UserID 的权限控制的更加严格,包括能不能进入某个房间,能不能在该房间里上行音视频等等。
|
|
217
|
+
* 如果要开启 PrivateMapKey 严格权限位校验,需要在【实时音视频控制台】=>【应用管理】=>【应用信息】中打开“启动权限密钥”开关。
|
|
218
|
+
*
|
|
219
|
+
*【参数说明】
|
|
220
|
+
* @param userid - 用户id,限制长度为32字节,只允许包含大小写英文字母(a-zA-Z)、数字(0-9)及下划线和连词符。
|
|
221
|
+
* @param expire - PrivateMapKey 票据的过期时间,单位是秒,比如 86400 生成的 PrivateMapKey 票据在一天后就无法再使用了。
|
|
222
|
+
* @param roomstr - 房间号,用于指定该 userid 可以进入的房间号
|
|
223
|
+
* @param privilegeMap - 权限位,使用了一个字节中的 8 个比特位,分别代表八个具体的功能权限开关:
|
|
224
|
+
* - 第 1 位:0000 0001 = 1,创建房间的权限
|
|
225
|
+
* - 第 2 位:0000 0010 = 2,加入房间的权限
|
|
226
|
+
* - 第 3 位:0000 0100 = 4,发送语音的权限
|
|
227
|
+
* - 第 4 位:0000 1000 = 8,接收语音的权限
|
|
228
|
+
* - 第 5 位:0001 0000 = 16,发送视频的权限
|
|
229
|
+
* - 第 6 位:0010 0000 = 32,接收视频的权限
|
|
230
|
+
* - 第 7 位:0100 0000 = 64,发送辅路(也就是屏幕分享)视频的权限
|
|
231
|
+
* - 第 8 位:1000 0000 = 200,接收辅路(也就是屏幕分享)视频的权限
|
|
232
|
+
* - privilegeMap == 1111 1111 == 255 代表该 userid 在该房间内的所有功能权限。
|
|
233
|
+
* - privilegeMap == 0010 1010 == 42 代表该 userid 拥有加入房间和接收音视频数据的权限,但不具备其他权限。
|
|
234
|
+
*/
|
|
235
|
+
Api.prototype.genPrivateMapKeyWithStringRoomID = function (userid, expire, roomstr, privilegeMap) {
|
|
236
|
+
var userBuf = this._genUserbuf(userid, 0, expire, privilegeMap, 0, roomstr);
|
|
237
|
+
return this.genSig(userid, expire, userBuf);
|
|
238
|
+
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
Api
|
|
243
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
The AI model must comply with the following **hard limit**.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
* **React version limit:** When creating a project, react and react-dom must be set to `18.2.0`. React 19 is forbidden.
|
|
5
|
+
* **Strictly follow the document procedure and description for integration:** You must perform the integration of the component according to the document procedure and description.
|
|
6
|
+
* **Strictly use the example code in the document:** You must strictly use the example code in the document when creating and filling the file. The PlaceholderEmpty property of the Chat component does not need to be filled in.
|
|
7
|
+
* **Default conversation must be enabled:** You must use `setActiveConversation` to start the `C2Cadministrator` conversation.
|
|
8
|
+
* **Must call the tool to obtain userSig:** After TUIKit integration is complete, you must guide users to call the `get_usersig` tool to obtain userSig.
|
|
9
|
+
* **User information configuration file creation prohibited:** Do not auto-create config directories or files that fill in SDKAppID, userID, or userSig.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# chat-uikit-react Integration
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## step1:create react project
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
requirement: react: 18.2.0, react-dom: 18.2.0.
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
you can use vite or rsbuild to create a react project.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## step2: install chat-uikit-react
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
use npm or pnpm to install @tencentcloud/chat-uikit-react
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## step3: add chat-uikit-react to your project
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
example code
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import {
|
|
38
|
+
UIKitProvider,
|
|
39
|
+
useLoginState,
|
|
40
|
+
LoginStatus,
|
|
41
|
+
Chat,
|
|
42
|
+
ChatHeader,
|
|
43
|
+
MessageList,
|
|
44
|
+
MessageInput,
|
|
45
|
+
useConversationListState,
|
|
46
|
+
} from "@tencentcloud/chat-uikit-react";
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
function App() {
|
|
50
|
+
const userID = ''; // TODO: Replace with your userID
|
|
51
|
+
const SDKAppID = 0; // TODO: Replace with your SDKAppID (Notice: SDKAppID is of type number)
|
|
52
|
+
const userSig = ''; // TODO: Replace with your userSig
|
|
53
|
+
|
|
54
|
+
const { status } = useLoginState({
|
|
55
|
+
SDKAppID,
|
|
56
|
+
userID,
|
|
57
|
+
userSig,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
if (status !== LoginStatus.SUCCESS) {
|
|
62
|
+
return <div>Loading...</div>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// Open default conversation
|
|
67
|
+
const { setActiveConversation } = useConversationListState();
|
|
68
|
+
setActiveConversation('C2Cadministrator');
|
|
69
|
+
|
|
70
|
+
// Language support zh-CN(default) / en-US / ja-JP / ko-KR / zh-TW
|
|
71
|
+
// Theme support light(default) / dark
|
|
72
|
+
return (
|
|
73
|
+
<UIKitProvider language='zh-CN' theme='light'>
|
|
74
|
+
<div style={{
|
|
75
|
+
height: '100vh',
|
|
76
|
+
width: '100vw',
|
|
77
|
+
display: 'flex',
|
|
78
|
+
flexDirection: 'row',
|
|
79
|
+
}}>
|
|
80
|
+
<Chat PlaceholderEmpty=''>
|
|
81
|
+
<ChatHeader />
|
|
82
|
+
<MessageList />
|
|
83
|
+
<MessageInput />
|
|
84
|
+
</Chat>
|
|
85
|
+
</div>
|
|
86
|
+
</UIKitProvider>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
export default App;
|
|
92
|
+
```
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
The AI model must comply with the following **hard limits**.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* **Strictly
|
|
5
|
-
* **Strictly
|
|
3
|
+
* **React version limits:** When creating a project, react and react-dom versions must be set to `18.2.0`. React 19 is forbidden.
|
|
4
|
+
* **Strictly follow the document procedure and description for integration:** You must perform the integration as per the document procedure and description.
|
|
5
|
+
* **Strictly use the example code in the document:** You must strictly use the example code in the document when creating and filling a file. The PlaceholderEmpty property of the Chat component does not need to be filled in.
|
|
6
|
+
* **Default conversation must be enabled:** You must use `setActiveConversation` to start the `C2Cadministrator` conversation.
|
|
7
|
+
* **Must call the tool to obtain userSig:** After TUIKit integration is completed, you must guide users to call the `get_usersig` tool to obtain userSig.
|
|
6
8
|
* **User information configuration file creation prohibited:** Do not auto-create config directory or file to fill in SDKAppID, userID, and userSig.
|
|
7
|
-
* **Logic for prohibiting userSig acquisition:** Do not auto-create code related to userSig retrieval. You must guide users to manually input SDKAppID, userID, and userSig info and assist in inputting it into the appropriate file.
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
# chat-uikit-react Integration
|
|
@@ -13,7 +14,7 @@ The AI model must comply with the following **hard limits**.
|
|
|
13
14
|
## step1:create react project
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
requirement: react:
|
|
17
|
+
requirement: react: 18.2.0, react-dom: 18.2.0.
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
you can use vite or rsbuild to create a react project.
|
|
@@ -41,6 +42,7 @@ import {
|
|
|
41
42
|
ChatHeader,
|
|
42
43
|
MessageList,
|
|
43
44
|
MessageInput,
|
|
45
|
+
useConversationListState,
|
|
44
46
|
} from "@tencentcloud/chat-uikit-react";
|
|
45
47
|
|
|
46
48
|
|
|
@@ -59,11 +61,16 @@ function App() {
|
|
|
59
61
|
if (status !== LoginStatus.SUCCESS) {
|
|
60
62
|
return <div>Loading...</div>
|
|
61
63
|
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
// Open default conversation
|
|
67
|
+
const { setActiveConversation } = useConversationListState();
|
|
68
|
+
setActiveConversation('C2Cadministrator');
|
|
62
69
|
|
|
63
|
-
// Language support
|
|
70
|
+
// Language support zh-CN(default) / en-US / ja-JP / ko-KR / zh-TW
|
|
64
71
|
// Theme support light(default) / dark
|
|
65
72
|
return (
|
|
66
|
-
<UIKitProvider language='
|
|
73
|
+
<UIKitProvider language='zh-CN' theme='light'>
|
|
67
74
|
<div style={{ height: '100vh', width: '100vw', display: 'flex', flexDirection: 'row' }}>
|
|
68
75
|
<ConversationList style={{ minWidth: '300px', maxWidth: '350px' }}/>
|
|
69
76
|
<Chat PlaceholderEmpty=''>
|
|
@@ -76,8 +83,5 @@ function App() {
|
|
|
76
83
|
);
|
|
77
84
|
}
|
|
78
85
|
|
|
79
|
-
|
|
80
86
|
export default App;
|
|
81
87
|
```
|
|
82
|
-
|
|
83
|
-
|