polyv-live-cli 1.0.2
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/LICENSE +21 -0
- package/README.md +417 -0
- package/dist/commands/channel.commands.d.ts +9 -0
- package/dist/commands/channel.commands.d.ts.map +1 -0
- package/dist/commands/channel.commands.js +439 -0
- package/dist/commands/channel.commands.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +8 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/stream.commands.d.ts +3 -0
- package/dist/commands/stream.commands.d.ts.map +1 -0
- package/dist/commands/stream.commands.js +272 -0
- package/dist/commands/stream.commands.js.map +1 -0
- package/dist/config/auth.d.ts +11 -0
- package/dist/config/auth.d.ts.map +1 -0
- package/dist/config/auth.js +124 -0
- package/dist/config/auth.js.map +1 -0
- package/dist/config/loader.d.ts +22 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +127 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/manager.d.ts +20 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +258 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/validator.d.ts +43 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +222 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/handlers/base.handler.d.ts +15 -0
- package/dist/handlers/base.handler.d.ts.map +1 -0
- package/dist/handlers/base.handler.js +122 -0
- package/dist/handlers/base.handler.js.map +1 -0
- package/dist/handlers/channel.handler.d.ts +31 -0
- package/dist/handlers/channel.handler.d.ts.map +1 -0
- package/dist/handlers/channel.handler.js +690 -0
- package/dist/handlers/channel.handler.js.map +1 -0
- package/dist/handlers/index.d.ts +4 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +10 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/stream.handler.d.ts +25 -0
- package/dist/handlers/stream.handler.d.ts.map +1 -0
- package/dist/handlers/stream.handler.js +241 -0
- package/dist/handlers/stream.handler.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +342 -0
- package/dist/index.js.map +1 -0
- package/dist/services/channel.service.d.ts +25 -0
- package/dist/services/channel.service.d.ts.map +1 -0
- package/dist/services/channel.service.js +672 -0
- package/dist/services/channel.service.js.map +1 -0
- package/dist/services/index.d.ts +3 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +8 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/stream.service.d.ts +29 -0
- package/dist/services/stream.service.d.ts.map +1 -0
- package/dist/services/stream.service.js +489 -0
- package/dist/services/stream.service.js.map +1 -0
- package/dist/types/auth.d.ts +31 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +14 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/channel.d.ts +262 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/channel.js +3 -0
- package/dist/types/channel.js.map +1 -0
- package/dist/types/config.d.ts +82 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +56 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/signature.d.ts +22 -0
- package/dist/types/signature.d.ts.map +1 -0
- package/dist/types/signature.js +3 -0
- package/dist/types/signature.js.map +1 -0
- package/dist/types/stream.d.ts +104 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/dist/types/stream.js +3 -0
- package/dist/types/stream.js.map +1 -0
- package/dist/utils/confirmation.d.ts +12 -0
- package/dist/utils/confirmation.d.ts.map +1 -0
- package/dist/utils/confirmation.js +164 -0
- package/dist/utils/confirmation.js.map +1 -0
- package/dist/utils/errors.d.ts +40 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +113 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/formatter.d.ts +8 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +93 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +20 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/signature.d.ts +9 -0
- package/dist/utils/signature.d.ts.map +1 -0
- package/dist/utils/signature.js +77 -0
- package/dist/utils/signature.js.map +1 -0
- package/package.json +86 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 PolyV Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
# PolyV Live CLI 保利威直播云CLI工具
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
[](https://github.com/terryso/polyv-live-cli/actions/workflows/ci.yml)
|
|
11
|
+
[](https://github.com/terryso/polyv-live-cli/actions/workflows/release.yml)
|
|
12
|
+
[](https://codecov.io/gh/terryso/polyv-live-cli)
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
[](https://www.typescriptlang.org/)
|
|
20
|
+
[](https://nodejs.org/)
|
|
21
|
+
[](https://github.com/tj/commander.js)
|
|
22
|
+
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
一个强大的命令行工具,用于管理保利威(PolyV)直播云服务。支持频道管理、直播流控制等核心功能,提供完整的API集成和友好的用户体验。
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## ✨ 特性
|
|
29
|
+
|
|
30
|
+
### 🏗️ 核心功能
|
|
31
|
+
- **频道管理**: 创建、查看、更新、删除直播频道
|
|
32
|
+
- **流控制**: 获取推流密钥、开始/停止直播、实时状态监控
|
|
33
|
+
- **认证集成**: 完整的PolyV OpenAPI认证支持
|
|
34
|
+
- **多输出格式**: 支持表格和JSON格式输出
|
|
35
|
+
|
|
36
|
+
### 🛠️ 技术特性
|
|
37
|
+
- **TypeScript**: 完整的类型安全和智能提示
|
|
38
|
+
- **分层架构**: 清晰的命令、处理器、服务分层设计
|
|
39
|
+
- **错误处理**: 用户友好的错误消息和详细的调试信息
|
|
40
|
+
- **配置灵活**: 支持环境变量、命令行参数、配置文件
|
|
41
|
+
- **测试完备**: 80%+测试覆盖率,包含单元测试和集成测试
|
|
42
|
+
|
|
43
|
+
## 📦 安装
|
|
44
|
+
|
|
45
|
+
### 全局安装
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g polyv-live-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 本地开发
|
|
51
|
+
```bash
|
|
52
|
+
git clone https://github.com/your-repo/polyv-cli.git
|
|
53
|
+
cd polyv-cli
|
|
54
|
+
npm install
|
|
55
|
+
npm run build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 🚀 快速开始
|
|
59
|
+
|
|
60
|
+
### 1. 配置认证信息
|
|
61
|
+
|
|
62
|
+
**方法一:环境变量**
|
|
63
|
+
```bash
|
|
64
|
+
export POLYV_APP_ID="your_app_id"
|
|
65
|
+
export POLYV_APP_SECRET="your_app_secret"
|
|
66
|
+
export POLYV_USER_ID="your_user_id" # 可选
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**方法二:命令行参数**
|
|
70
|
+
```bash
|
|
71
|
+
polyv-cli --appId your_app_id --appSecret your_app_secret [command]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### 2. 基础使用示例
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 查看帮助
|
|
78
|
+
polyv-cli --help
|
|
79
|
+
|
|
80
|
+
# 查看版本
|
|
81
|
+
polyv-cli --version
|
|
82
|
+
|
|
83
|
+
# 创建频道
|
|
84
|
+
polyv-cli channel create --name "我的直播间" --scene topclass
|
|
85
|
+
|
|
86
|
+
# 查看频道列表
|
|
87
|
+
polyv-cli channel list
|
|
88
|
+
|
|
89
|
+
# 获取推流密钥
|
|
90
|
+
polyv-cli stream get-key --channelId 3151318
|
|
91
|
+
|
|
92
|
+
# 开始直播
|
|
93
|
+
polyv-cli stream start --channelId 3151318
|
|
94
|
+
|
|
95
|
+
# 查看直播状态
|
|
96
|
+
polyv-cli stream status --channelId 3151318
|
|
97
|
+
|
|
98
|
+
# 停止直播
|
|
99
|
+
polyv-cli stream stop --channelId 3151318
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## 📋 命令参考
|
|
103
|
+
|
|
104
|
+
### 频道管理 (Channel Management)
|
|
105
|
+
|
|
106
|
+
#### 创建频道
|
|
107
|
+
```bash
|
|
108
|
+
polyv-cli channel create [options]
|
|
109
|
+
|
|
110
|
+
选项:
|
|
111
|
+
--name <string> 频道名称 (必需)
|
|
112
|
+
--scene <string> 场景类型: topclass|ppt|pure (必需)
|
|
113
|
+
--description <string> 频道描述
|
|
114
|
+
--publisher <string> 主持人名称
|
|
115
|
+
--password <string> 频道密码
|
|
116
|
+
--max-viewers <number> 最大观看人数
|
|
117
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### 查看频道列表
|
|
121
|
+
```bash
|
|
122
|
+
polyv-cli channel list [options]
|
|
123
|
+
|
|
124
|
+
选项:
|
|
125
|
+
--page <number> 页码 (默认: 1)
|
|
126
|
+
--per-page <number> 每页数量 (默认: 20)
|
|
127
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### 获取频道详情
|
|
131
|
+
```bash
|
|
132
|
+
polyv-cli channel get --channelId <id> [options]
|
|
133
|
+
|
|
134
|
+
选项:
|
|
135
|
+
--channelId <string> 频道ID (必需)
|
|
136
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### 更新频道
|
|
140
|
+
```bash
|
|
141
|
+
polyv-cli channel update --channelId <id> [options]
|
|
142
|
+
|
|
143
|
+
选项:
|
|
144
|
+
--channelId <string> 频道ID (必需)
|
|
145
|
+
--name <string> 频道名称
|
|
146
|
+
--description <string> 频道描述
|
|
147
|
+
--publisher <string> 主持人名称
|
|
148
|
+
--password <string> 频道密码
|
|
149
|
+
--max-viewers <number> 最大观看人数
|
|
150
|
+
--start-time <timestamp> 开始时间 (13位时间戳)
|
|
151
|
+
--end-time <timestamp> 结束时间 (13位时间戳)
|
|
152
|
+
--page-views <number> 累积观看数
|
|
153
|
+
--likes <number> 点赞数
|
|
154
|
+
--cover-img <url> 封面图片URL
|
|
155
|
+
--splash-img <url> 引导页图片URL
|
|
156
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
#### 删除频道
|
|
160
|
+
```bash
|
|
161
|
+
polyv-cli channel delete --channelId <id>
|
|
162
|
+
|
|
163
|
+
选项:
|
|
164
|
+
--channelId <string> 频道ID (必需)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 流控制 (Stream Control)
|
|
168
|
+
|
|
169
|
+
#### 获取推流密钥
|
|
170
|
+
```bash
|
|
171
|
+
polyv-cli stream get-key --channelId <id> [options]
|
|
172
|
+
|
|
173
|
+
选项:
|
|
174
|
+
--channelId <string> 频道ID (必需)
|
|
175
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### 开始直播
|
|
179
|
+
```bash
|
|
180
|
+
polyv-cli stream start --channelId <id>
|
|
181
|
+
|
|
182
|
+
选项:
|
|
183
|
+
--channelId <string> 频道ID (必需)
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### 停止直播
|
|
187
|
+
```bash
|
|
188
|
+
polyv-cli stream stop --channelId <id>
|
|
189
|
+
|
|
190
|
+
选项:
|
|
191
|
+
--channelId <string> 频道ID (必需)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### 查看流状态
|
|
195
|
+
```bash
|
|
196
|
+
polyv-cli stream status --channelId <id> [options]
|
|
197
|
+
|
|
198
|
+
选项:
|
|
199
|
+
--channelId <string> 频道ID (必需)
|
|
200
|
+
--output <format> 输出格式: table|json (默认: table)
|
|
201
|
+
--watch 持续监控模式 (5秒更新)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 🎯 使用场景
|
|
205
|
+
|
|
206
|
+
### 1. 批量频道管理
|
|
207
|
+
```bash
|
|
208
|
+
# 批量创建频道
|
|
209
|
+
for i in {1..5}; do
|
|
210
|
+
polyv-cli channel create --name "批量频道$i" --scene topclass --publisher "主持人$i"
|
|
211
|
+
done
|
|
212
|
+
|
|
213
|
+
# 查看所有频道
|
|
214
|
+
polyv-cli channel list --per-page 50 --output json
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 2. 自动化直播流程
|
|
218
|
+
```bash
|
|
219
|
+
#!/bin/bash
|
|
220
|
+
CHANNEL_ID="3151318"
|
|
221
|
+
|
|
222
|
+
echo "🚀 开始直播..."
|
|
223
|
+
polyv-cli stream start --channelId $CHANNEL_ID
|
|
224
|
+
|
|
225
|
+
echo "📡 获取推流信息..."
|
|
226
|
+
polyv-cli stream get-key --channelId $CHANNEL_ID
|
|
227
|
+
|
|
228
|
+
echo "📊 监控直播状态..."
|
|
229
|
+
polyv-cli stream status --channelId $CHANNEL_ID --watch
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### 3. CI/CD集成
|
|
233
|
+
```bash
|
|
234
|
+
# 在CI/CD流水线中使用
|
|
235
|
+
polyv-cli channel create \
|
|
236
|
+
--name "自动化测试频道" \
|
|
237
|
+
--scene topclass \
|
|
238
|
+
--description "CI/CD自动创建" \
|
|
239
|
+
--output json > channel_info.json
|
|
240
|
+
|
|
241
|
+
CHANNEL_ID=$(cat channel_info.json | jq -r '.channelId')
|
|
242
|
+
echo "创建的频道ID: $CHANNEL_ID"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## ⚙️ 配置选项
|
|
246
|
+
|
|
247
|
+
### 环境变量
|
|
248
|
+
| 变量名 | 说明 | 必需 |
|
|
249
|
+
|--------|------|------|
|
|
250
|
+
| `POLYV_APP_ID` | PolyV应用ID | ✅ |
|
|
251
|
+
| `POLYV_APP_SECRET` | PolyV应用密钥 | ✅ |
|
|
252
|
+
| `POLYV_USER_ID` | PolyV用户ID | ❌ |
|
|
253
|
+
| `POLYV_BASE_URL` | API基础URL | ❌ |
|
|
254
|
+
| `POLYV_TIMEOUT` | 请求超时时间(ms) | ❌ |
|
|
255
|
+
| `DEBUG` | 调试模式 | ❌ |
|
|
256
|
+
|
|
257
|
+
### 优先级顺序
|
|
258
|
+
1. 命令行参数 (最高优先级)
|
|
259
|
+
2. 环境变量
|
|
260
|
+
3. 配置文件
|
|
261
|
+
4. 默认值 (最低优先级)
|
|
262
|
+
|
|
263
|
+
## 🔐 认证与安全
|
|
264
|
+
|
|
265
|
+
### PolyV API认证
|
|
266
|
+
本工具使用PolyV官方的MD5签名认证机制:
|
|
267
|
+
|
|
268
|
+
1. **参数收集**: 收集appId、timestamp、channelId等参数
|
|
269
|
+
2. **参数排序**: 按字典序排序参数
|
|
270
|
+
3. **字符串拼接**: 格式为 `appSecret + 排序后参数 + appSecret`
|
|
271
|
+
4. **MD5签名**: 计算MD5哈希值并转换为大写
|
|
272
|
+
5. **请求发送**: 将签名作为sign参数发送
|
|
273
|
+
|
|
274
|
+
### 安全最佳实践
|
|
275
|
+
- ✅ 使用环境变量存储敏感信息
|
|
276
|
+
- ✅ 敏感数据在输出中自动脱敏
|
|
277
|
+
- ✅ 不在日志中记录密钥信息
|
|
278
|
+
- ✅ 支持用户级别的权限控制
|
|
279
|
+
|
|
280
|
+
## 🧪 测试
|
|
281
|
+
|
|
282
|
+
### 运行测试
|
|
283
|
+
```bash
|
|
284
|
+
# 运行所有测试
|
|
285
|
+
npm test
|
|
286
|
+
|
|
287
|
+
# 运行单元测试
|
|
288
|
+
npm run test:unit
|
|
289
|
+
|
|
290
|
+
# 运行集成测试
|
|
291
|
+
npm run test:integration
|
|
292
|
+
|
|
293
|
+
# 查看测试覆盖率
|
|
294
|
+
npm run test:coverage
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### 测试覆盖率
|
|
298
|
+
- **单元测试**: 80%+ 代码覆盖率
|
|
299
|
+
- **集成测试**: 核心工作流全覆盖
|
|
300
|
+
- **错误处理**: 各种异常场景测试
|
|
301
|
+
|
|
302
|
+
## 🐛 故障排除
|
|
303
|
+
|
|
304
|
+
### 常见问题
|
|
305
|
+
|
|
306
|
+
#### 1. 认证失败
|
|
307
|
+
```bash
|
|
308
|
+
❌ 认证失败: 无效的appId或appSecret
|
|
309
|
+
|
|
310
|
+
解决方案:
|
|
311
|
+
- 检查POLYV_APP_ID和POLYV_APP_SECRET环境变量
|
|
312
|
+
- 确认PolyV控制台中的应用凭据
|
|
313
|
+
- 验证网络连接和防火墙设置
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
#### 2. 频道未找到
|
|
317
|
+
```bash
|
|
318
|
+
❌ 频道未找到: 频道ID 3151318 不存在
|
|
319
|
+
|
|
320
|
+
解决方案:
|
|
321
|
+
- 确认频道ID是否正确
|
|
322
|
+
- 检查账号是否有访问该频道的权限
|
|
323
|
+
- 使用 channel list 命令查看可用频道
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### 3. 推流密钥获取失败
|
|
327
|
+
```bash
|
|
328
|
+
❌ 获取推流密钥失败: 频道未在直播状态
|
|
329
|
+
|
|
330
|
+
解决方案:
|
|
331
|
+
- 使用 stream start 命令先开始直播
|
|
332
|
+
- 确认频道类型支持推流功能
|
|
333
|
+
- 检查频道配置是否正确
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### 调试模式
|
|
337
|
+
```bash
|
|
338
|
+
# 启用详细调试信息
|
|
339
|
+
DEBUG=1 polyv-cli [command]
|
|
340
|
+
|
|
341
|
+
# 或设置环境变量
|
|
342
|
+
export DEBUG=1
|
|
343
|
+
polyv-cli [command]
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
## 🏗️ 开发
|
|
347
|
+
|
|
348
|
+
### 项目结构
|
|
349
|
+
```
|
|
350
|
+
src/
|
|
351
|
+
├── commands/ # CLI命令定义
|
|
352
|
+
│ ├── channel.commands.ts
|
|
353
|
+
│ └── stream.commands.ts
|
|
354
|
+
├── handlers/ # 业务逻辑处理器
|
|
355
|
+
│ ├── channel.handler.ts
|
|
356
|
+
│ └── stream.handler.ts
|
|
357
|
+
├── services/ # API服务层
|
|
358
|
+
│ ├── channel.service.ts
|
|
359
|
+
│ └── stream.service.ts
|
|
360
|
+
├── types/ # TypeScript类型定义
|
|
361
|
+
│ ├── channel.ts
|
|
362
|
+
│ ├── stream.ts
|
|
363
|
+
│ └── auth.ts
|
|
364
|
+
├── utils/ # 工具函数
|
|
365
|
+
│ ├── errors.ts
|
|
366
|
+
│ ├── formatter.ts
|
|
367
|
+
│ └── signature.ts
|
|
368
|
+
└── config/ # 配置管理
|
|
369
|
+
└── manager.ts
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### 开发命令
|
|
373
|
+
```bash
|
|
374
|
+
# 开发模式
|
|
375
|
+
npm run dev
|
|
376
|
+
|
|
377
|
+
# 构建项目
|
|
378
|
+
npm run build
|
|
379
|
+
|
|
380
|
+
# 代码检查
|
|
381
|
+
npm run lint
|
|
382
|
+
|
|
383
|
+
# 类型检查
|
|
384
|
+
npm run type-check
|
|
385
|
+
|
|
386
|
+
# 清理构建
|
|
387
|
+
npm run clean
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### 贡献指南
|
|
391
|
+
1. Fork 项目仓库
|
|
392
|
+
2. 创建功能分支: `git checkout -b feature/new-feature`
|
|
393
|
+
3. 提交变更: `git commit -m 'feat: add new feature'`
|
|
394
|
+
4. 推送分支: `git push origin feature/new-feature`
|
|
395
|
+
5. 创建Pull Request
|
|
396
|
+
|
|
397
|
+
## 📄 许可证
|
|
398
|
+
|
|
399
|
+
本项目基于 [MIT License](LICENSE) 开源协议。
|
|
400
|
+
|
|
401
|
+
## 🆘 支持
|
|
402
|
+
|
|
403
|
+
### 获取帮助
|
|
404
|
+
- 📖 [PolyV官方文档](https://dev.polyv.net/)
|
|
405
|
+
- 🐛 [问题反馈](https://github.com/your-repo/polyv-cli/issues)
|
|
406
|
+
- 💬 [讨论区](https://github.com/your-repo/polyv-cli/discussions)
|
|
407
|
+
|
|
408
|
+
### 联系方式
|
|
409
|
+
- 邮箱: support@polyv.net
|
|
410
|
+
- 官网: https://www.polyv.net/
|
|
411
|
+
- 技术支持: 400-993-9533
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
**Made with ❤️ by PolyV Team**
|
|
416
|
+
|
|
417
|
+
> 🎯 让直播管理更简单,让开发者更高效!
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export declare function registerChannelCommands(program: Command): void;
|
|
3
|
+
declare function parseInteger(value: string): number;
|
|
4
|
+
declare function validateScene(value: string): 'topclass' | 'cloudclass' | 'telecast' | 'akt';
|
|
5
|
+
declare function validateTemplate(value: string): 'ppt' | 'video';
|
|
6
|
+
declare function validateLimit(value: string): number;
|
|
7
|
+
declare function validateOutputFormat(value: string): 'table' | 'json';
|
|
8
|
+
export { parseInteger, validateScene, validateTemplate, validateLimit, validateOutputFormat };
|
|
9
|
+
//# sourceMappingURL=channel.commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.commands.d.ts","sourceRoot":"","sources":["../../src/commands/channel.commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAud9D;AAOD,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM3C;AAOD,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,KAAK,CAMpF;AAOD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAMxD;AAOD,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS5C;AAOD,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAM7D;AAGD,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACrB,CAAC"}
|