@hecom/codearts 0.2.0 → 0.2.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.
@@ -1,22 +1,161 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
5
38
  Object.defineProperty(exports, "__esModule", { value: true });
6
39
  exports.configCommand = configCommand;
40
+ exports.updateProjectConfigCommand = updateProjectConfigCommand;
41
+ exports.getAvailableProjectConfigs = getAvailableProjectConfigs;
42
+ exports.showConfigCommand = showConfigCommand;
7
43
  const inquirer_1 = __importDefault(require("inquirer"));
8
- const global_config_1 = require("../utils/global-config");
44
+ const readline = __importStar(require("readline"));
45
+ const business_service_1 = require("../services/business.service");
46
+ const types_1 = require("../types");
47
+ const config_loader_1 = require("../utils/config-loader");
48
+ const logger_1 = require("../utils/logger");
49
+ /**
50
+ * 清除终端上指定行数的内容
51
+ * @param lines 要清除的行数
52
+ */
53
+ function clearLines(lines) {
54
+ for (let i = 0; i < lines; i++) {
55
+ readline.moveCursor(process.stdout, 0, -1); // 光标向上移动一行
56
+ readline.clearLine(process.stdout, 0); // 清除当前行
57
+ }
58
+ }
59
+ /**
60
+ * 配置角色 ID
61
+ */
62
+ async function configureRoleIds(businessService, projectId, existingValue) {
63
+ try {
64
+ const roles = await businessService.getProjectRoles(projectId);
65
+ if (roles.length === 0) {
66
+ // 如果没有获取到角色,使用手动输入
67
+ const { manualRoleId } = await inquirer_1.default.prompt([
68
+ {
69
+ type: 'input',
70
+ name: 'manualRoleId',
71
+ message: '角色 ID(支持逗号分隔,如: 1,2,3):',
72
+ default: existingValue || '',
73
+ validate: (input) => {
74
+ if (!input.trim()) {
75
+ return '角色 ID 不能为空';
76
+ }
77
+ const ids = input.split(',').map((id) => id.trim());
78
+ const allValid = ids.every((id) => /^\d+$/.test(id));
79
+ return allValid ? true : '角色 ID 必须是数字或逗号分隔的数字列表';
80
+ },
81
+ },
82
+ ]);
83
+ return manualRoleId;
84
+ }
85
+ else {
86
+ // 使用多选框选择角色
87
+ const roleChoices = roles.map((role) => ({
88
+ name: `${role.role_name} (${role.role_id})`,
89
+ value: role.role_id.toString(),
90
+ checked: existingValue ? existingValue.split(',').includes(role.role_id.toString()) : false,
91
+ }));
92
+ const { selectedRoleIds } = await inquirer_1.default.prompt([
93
+ {
94
+ type: 'checkbox',
95
+ name: 'selectedRoleIds',
96
+ message: '请选择角色:',
97
+ choices: roleChoices,
98
+ validate: (input) => {
99
+ if (input.length === 0) {
100
+ return '至少选择一个角色';
101
+ }
102
+ return true;
103
+ },
104
+ },
105
+ ]);
106
+ return selectedRoleIds.join(',');
107
+ }
108
+ }
109
+ catch (error) {
110
+ logger_1.logger.error('❌ 获取角色列表失败:', error);
111
+ // 如果获取失败,使用手动输入
112
+ const { manualRoleId } = await inquirer_1.default.prompt([
113
+ {
114
+ type: 'input',
115
+ name: 'manualRoleId',
116
+ message: '角色 ID(支持逗号分隔,如: 1,2,3):',
117
+ default: existingValue || '',
118
+ validate: (input) => {
119
+ if (!input.trim()) {
120
+ return '角色 ID 不能为空';
121
+ }
122
+ const ids = input.split(',').map((id) => id.trim());
123
+ const allValid = ids.every((id) => /^\d+$/.test(id));
124
+ return allValid ? true : '角色 ID 必须是数字或逗号分隔的数字列表';
125
+ },
126
+ },
127
+ ]);
128
+ return manualRoleId;
129
+ }
130
+ }
131
+ /**
132
+ * 第三阶段项目配置项列表
133
+ * 未来可以在这里添加更多配置项
134
+ */
135
+ const PROJECT_CONFIG_ITEMS = [
136
+ {
137
+ key: types_1.ConfigKey.ROLE_ID,
138
+ label: '角色配置',
139
+ configure: configureRoleIds,
140
+ },
141
+ // 未来可以在这里添加更多配置项,例如:
142
+ // {
143
+ // key: ConfigKey.CUSTOM_FIELD,
144
+ // label: '自定义字段配置',
145
+ // configure: configureCustomField,
146
+ // },
147
+ ];
9
148
  /**
10
149
  * 交互式配置向导命令
11
150
  * 引导用户创建或更新全局配置文件
12
151
  */
13
152
  async function configCommand() {
14
- console.log('\n欢迎使用 Hecom CodeArts 配置向导');
15
- console.log('='.repeat(60));
16
- console.log('此向导将帮助您配置华为云 CodeArts API 访问凭证。');
17
- console.log(`配置将保存到: ${(0, global_config_1.getGlobalConfigPath)()}\n`);
18
- const existingConfig = (0, global_config_1.globalConfigExists)() ? (0, global_config_1.readGlobalConfig)() : {};
19
- if ((0, global_config_1.globalConfigExists)()) {
153
+ logger_1.logger.info('\n欢迎使用 Hecom CodeArts 配置向导');
154
+ logger_1.logger.info('='.repeat(60));
155
+ logger_1.logger.info('此向导将帮助您配置华为云 CodeArts API 访问凭证。');
156
+ logger_1.logger.info(`配置将保存到: ${(0, config_loader_1.getConfigPath)()}\n`);
157
+ const existingConfig = (0, config_loader_1.configExists)() ? (0, config_loader_1.readConfig)() : {};
158
+ if ((0, config_loader_1.configExists)()) {
20
159
  const { overwrite } = await inquirer_1.default.prompt([
21
160
  {
22
161
  type: 'confirm',
@@ -26,84 +165,292 @@ async function configCommand() {
26
165
  },
27
166
  ]);
28
167
  if (!overwrite) {
29
- console.log('\n已取消配置。');
168
+ logger_1.logger.info('\n已取消配置。');
30
169
  return;
31
170
  }
32
171
  }
33
- const answers = await inquirer_1.default.prompt([
34
- {
35
- type: 'input',
36
- name: 'iamEndpoint',
37
- message: 'IAM 认证端点:',
38
- default: existingConfig.HUAWEI_CLOUD_IAM_ENDPOINT || 'https://iam.cn-north-4.myhuaweicloud.com',
39
- },
40
- {
41
- type: 'input',
42
- name: 'region',
43
- message: '华为云区域:',
44
- default: existingConfig.HUAWEI_CLOUD_REGION || 'cn-north-4',
45
- },
46
- {
47
- type: 'input',
48
- name: 'username',
49
- message: 'IAM 用户名:',
50
- default: existingConfig.HUAWEI_CLOUD_USERNAME || '',
51
- validate: (input) => (input.trim() ? true : 'IAM 用户名不能为空'),
52
- },
53
- {
54
- type: 'password',
55
- name: 'password',
56
- message: 'IAM 密码:',
57
- mask: '*',
58
- default: existingConfig.HUAWEI_CLOUD_PASSWORD || '',
59
- validate: (input) => (input.trim() ? true : 'IAM 密码不能为空'),
60
- },
61
- {
62
- type: 'input',
63
- name: 'domain',
64
- message: '华为云账号名:',
65
- default: existingConfig.HUAWEI_CLOUD_DOMAIN || '',
66
- validate: (input) => (input.trim() ? true : '华为云账号名不能为空'),
67
- },
68
- {
69
- type: 'input',
70
- name: 'codeartsUrl',
71
- message: 'CodeArts API 地址:',
72
- default: existingConfig.CODEARTS_BASE_URL || 'https://projectman-ext.cn-north-4.myhuaweicloud.cn',
73
- },
74
- {
75
- type: 'input',
76
- name: 'projectId',
77
- message: '项目 ID:',
78
- default: existingConfig.PROJECT_ID || '',
79
- validate: (input) => (input.trim() ? true : '项目 ID 不能为空'),
80
- },
81
- {
82
- type: 'input',
83
- name: 'roleId',
84
- message: '角色 ID(支持逗号分隔,如: 1,2,3):',
85
- default: existingConfig.ROLE_ID || '',
86
- validate: (input) => {
87
- if (!input.trim()) {
88
- return '角色 ID 不能为空';
89
- }
90
- const ids = input.split(',').map((id) => id.trim());
91
- const allValid = ids.every((id) => /^\d+$/.test(id));
92
- return allValid ? true : '角色 ID 必须是数字或逗号分隔的数字列表';
172
+ // 第一阶段:IAM 凭证配置
173
+ let credentialsValid = false;
174
+ let businessService = null;
175
+ let iamAnswers = {
176
+ iamEndpoint: '',
177
+ region: '',
178
+ codeartsUrl: '',
179
+ domain: '',
180
+ username: '',
181
+ password: '',
182
+ };
183
+ while (!credentialsValid) {
184
+ iamAnswers = await inquirer_1.default.prompt([
185
+ {
186
+ type: 'input',
187
+ name: 'iamEndpoint',
188
+ message: 'IAM 认证端点:',
189
+ default: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_IAM_ENDPOINT] ||
190
+ 'https://iam.cn-north-4.myhuaweicloud.com',
191
+ validate: (input) => (input.trim() ? true : 'IAM 认证端点不能为空'),
192
+ },
193
+ {
194
+ type: 'input',
195
+ name: 'region',
196
+ message: '华为云区域:',
197
+ default: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_REGION] || 'cn-north-4',
198
+ validate: (input) => (input.trim() ? true : '华为云区域不能为空'),
199
+ },
200
+ {
201
+ type: 'input',
202
+ name: 'codeartsUrl',
203
+ message: 'CodeArts API 地址:',
204
+ default: existingConfig[types_1.ConfigKey.CODEARTS_BASE_URL] ||
205
+ 'https://projectman-ext.cn-north-4.myhuaweicloud.cn',
206
+ validate: (input) => (input.trim() ? true : 'CodeArts API 地址不能为空'),
207
+ },
208
+ {
209
+ type: 'input',
210
+ name: 'domain',
211
+ message: '华为云账号名:',
212
+ default: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_DOMAIN] || '',
213
+ validate: (input) => (input.trim() ? true : '华为云账号名不能为空'),
214
+ },
215
+ {
216
+ type: 'input',
217
+ name: 'username',
218
+ message: 'IAM 用户名:',
219
+ default: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_USERNAME] || '',
220
+ validate: (input) => (input.trim() ? true : 'IAM 用户名不能为空'),
221
+ },
222
+ {
223
+ type: 'password',
224
+ name: 'password',
225
+ message: 'IAM 密码:',
226
+ mask: '*',
227
+ default: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD] || '',
228
+ validate: (input) => (input.trim() ? true : 'IAM 密码不能为空'),
93
229
  },
94
- },
95
- ]);
230
+ ]);
231
+ // 创建 BusinessService 实例
232
+ businessService = new business_service_1.BusinessService({
233
+ iamEndpoint: iamAnswers.iamEndpoint,
234
+ region: iamAnswers.region,
235
+ endpoint: iamAnswers.codeartsUrl,
236
+ username: iamAnswers.username,
237
+ password: iamAnswers.password,
238
+ domainName: iamAnswers.domain,
239
+ enableLogging: false,
240
+ });
241
+ // 验证凭证
242
+ const validationResult = await businessService.validateCredentials();
243
+ if (validationResult.success) {
244
+ credentialsValid = true;
245
+ }
246
+ else {
247
+ const errorMessage = `❌ IAM 凭证验证失败: ${validationResult.error}\n`;
248
+ logger_1.logger.error(errorMessage);
249
+ const { retry } = await inquirer_1.default.prompt([
250
+ {
251
+ type: 'confirm',
252
+ name: 'retry',
253
+ message: '是否重新配置 IAM 凭证?',
254
+ default: true,
255
+ },
256
+ ]);
257
+ if (!retry) {
258
+ logger_1.logger.info('\n已取消配置。');
259
+ return;
260
+ }
261
+ // 计算需要清除的行数
262
+ // 6个配置问题 + 错误信息行数 + 1行重试提示
263
+ const errorLines = errorMessage.split('\n').length - 1; // 减1因为最后一个\n不产生新行
264
+ const totalLines = 6 + errorLines + 1;
265
+ clearLines(totalLines);
266
+ }
267
+ }
268
+ // 第二阶段:获取项目列表并选择项目
269
+ let projectId;
96
270
  try {
97
- (0, global_config_1.writeGlobalConfig)(answers);
98
- console.log('\n✅ 全局配置已成功保存');
99
- console.log(`配置文件位置: ${(0, global_config_1.getGlobalConfigPath)()}`);
100
- console.log('\n您现在可以在任何目录使用以下命令:');
101
- console.log(' codearts daily # 生成日报');
102
- console.log(' codearts work-hour # 生成年度工时统计');
103
- console.log('\n提示:配置文件包含敏感信息,请妥善保管。');
271
+ const projects = await businessService.getProjects(100);
272
+ if (projects.length === 0) {
273
+ const { manualProjectId } = await inquirer_1.default.prompt([
274
+ {
275
+ type: 'input',
276
+ name: 'manualProjectId',
277
+ message: '项目 ID:',
278
+ default: existingConfig[types_1.ConfigKey.PROJECT_ID] || '',
279
+ validate: (input) => (input.trim() ? true : '项目 ID 不能为空'),
280
+ },
281
+ ]);
282
+ projectId = manualProjectId;
283
+ }
284
+ else {
285
+ const projectChoices = projects.map((p) => ({
286
+ name: `${p.project_name} (${p.project_id})`,
287
+ value: p.project_id,
288
+ }));
289
+ const { selectedProjectId } = await inquirer_1.default.prompt([
290
+ {
291
+ type: 'list',
292
+ name: 'selectedProjectId',
293
+ message: '请选择项目:',
294
+ choices: projectChoices,
295
+ default: existingConfig[types_1.ConfigKey.PROJECT_ID] || projectChoices[0]?.value,
296
+ },
297
+ ]);
298
+ projectId = selectedProjectId;
299
+ }
104
300
  }
105
301
  catch (error) {
106
- console.error('\n❌ 保存配置文件失败:', error);
302
+ const errorMsg = error instanceof Error ? error.message : String(error);
303
+ logger_1.logger.error(`❌ 获取项目列表失败: `, error);
304
+ // 获取失败,使用手动输入
305
+ const { manualProjectId } = await inquirer_1.default.prompt([
306
+ {
307
+ type: 'input',
308
+ name: 'manualProjectId',
309
+ message: '项目 ID:',
310
+ default: existingConfig[types_1.ConfigKey.PROJECT_ID] || '',
311
+ validate: (input) => (input.trim() ? true : '项目 ID 不能为空'),
312
+ },
313
+ ]);
314
+ projectId = manualProjectId;
315
+ }
316
+ // 第三阶段:配置项目相关配置
317
+ const projectConfigs = {};
318
+ for (const configItem of PROJECT_CONFIG_ITEMS) {
319
+ const value = await configItem.configure(businessService, projectId, existingConfig[configItem.key]);
320
+ projectConfigs[configItem.key] = value;
321
+ }
322
+ // 合并所有配置(转换为标准环境变量名)
323
+ const finalConfig = {
324
+ [types_1.ConfigKey.HUAWEI_CLOUD_IAM_ENDPOINT]: iamAnswers.iamEndpoint,
325
+ [types_1.ConfigKey.HUAWEI_CLOUD_REGION]: iamAnswers.region,
326
+ [types_1.ConfigKey.CODEARTS_BASE_URL]: iamAnswers.codeartsUrl,
327
+ [types_1.ConfigKey.HUAWEI_CLOUD_DOMAIN]: iamAnswers.domain,
328
+ [types_1.ConfigKey.HUAWEI_CLOUD_USERNAME]: iamAnswers.username,
329
+ [types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD]: iamAnswers.password,
330
+ [types_1.ConfigKey.PROJECT_ID]: projectId,
331
+ ...projectConfigs,
332
+ };
333
+ try {
334
+ (0, config_loader_1.writeConfig)(finalConfig);
335
+ logger_1.logger.success('\n✅ 全局配置已成功保存');
336
+ logger_1.logger.info(`配置文件位置: ${(0, config_loader_1.getConfigPath)()}`);
337
+ logger_1.logger.info('\n提示:配置文件包含敏感信息,请妥善保管。');
338
+ }
339
+ catch (error) {
340
+ logger_1.logger.error('\n❌ 保存配置文件失败:', error);
341
+ process.exit(1);
342
+ }
343
+ }
344
+ /**
345
+ * 单独更新某个项目配置项
346
+ * @param configKey 配置项的键名(例如 ConfigKey.ROLE_ID)
347
+ */
348
+ async function updateProjectConfigCommand(configKey) {
349
+ // 检查配置文件是否存在
350
+ if (!(0, config_loader_1.configExists)()) {
351
+ logger_1.logger.error('\n❌ 全局配置文件不存在,请先运行 `npx @hecom/codearts config` 创建配置。');
107
352
  process.exit(1);
108
353
  }
354
+ // 查找对应的配置项
355
+ const configItem = PROJECT_CONFIG_ITEMS.find((item) => item.key === configKey);
356
+ if (!configItem) {
357
+ logger_1.logger.error(`\n❌ 未知的配置项: ${configKey}`);
358
+ logger_1.logger.info(`\n可用的配置项:`);
359
+ PROJECT_CONFIG_ITEMS.forEach((item) => {
360
+ logger_1.logger.info(` - ${item.key}: ${item.label}`);
361
+ });
362
+ process.exit(1);
363
+ }
364
+ // 读取现有配置
365
+ const existingConfig = (0, config_loader_1.readConfig)();
366
+ // 检查必要的配置是否存在
367
+ if (!existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_USERNAME] ||
368
+ !existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD]) {
369
+ logger_1.logger.error('\n❌ 全局配置不完整,请先运行 `npx @hecom/codearts config` 完成配置。');
370
+ process.exit(1);
371
+ }
372
+ if (!existingConfig[types_1.ConfigKey.PROJECT_ID]) {
373
+ logger_1.logger.error('\n❌ 项目 ID 未配置,请先运行 `npx @hecom/codearts config` 完成配置。');
374
+ process.exit(1);
375
+ }
376
+ // 创建 BusinessService 实例
377
+ const businessService = new business_service_1.BusinessService({
378
+ iamEndpoint: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_IAM_ENDPOINT],
379
+ region: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_REGION],
380
+ endpoint: existingConfig[types_1.ConfigKey.CODEARTS_BASE_URL],
381
+ username: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_USERNAME],
382
+ password: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD],
383
+ domainName: existingConfig[types_1.ConfigKey.HUAWEI_CLOUD_DOMAIN],
384
+ enableLogging: false,
385
+ });
386
+ // 执行配置
387
+ const newValue = await configItem.configure(businessService, existingConfig[types_1.ConfigKey.PROJECT_ID], existingConfig[configKey]);
388
+ // 更新配置
389
+ const updatedConfig = {
390
+ ...existingConfig,
391
+ [configKey]: newValue,
392
+ };
393
+ try {
394
+ (0, config_loader_1.writeConfig)(updatedConfig);
395
+ logger_1.logger.success(`\n✅ ${configItem.label}已成功更新`);
396
+ logger_1.logger.info(`配置文件位置: ${(0, config_loader_1.getConfigPath)()}`);
397
+ }
398
+ catch (error) {
399
+ logger_1.logger.error('\n❌ 保存配置文件失败:', error);
400
+ process.exit(1);
401
+ }
402
+ }
403
+ /**
404
+ * 获取所有可用的项目配置项
405
+ */
406
+ function getAvailableProjectConfigs() {
407
+ return PROJECT_CONFIG_ITEMS;
408
+ }
409
+ /**
410
+ * 显示当前配置
411
+ *
412
+ */
413
+ async function showConfigCommand() {
414
+ // 获取最终合并后的配置
415
+ const config = (0, config_loader_1.getConfig)();
416
+ // 按类别显示配置
417
+ logger_1.logger.info('\n【华为云 IAM 凭证】');
418
+ const iamKeys = [
419
+ types_1.ConfigKey.HUAWEI_CLOUD_IAM_ENDPOINT,
420
+ types_1.ConfigKey.HUAWEI_CLOUD_REGION,
421
+ types_1.ConfigKey.HUAWEI_CLOUD_USERNAME,
422
+ types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD,
423
+ types_1.ConfigKey.HUAWEI_CLOUD_DOMAIN,
424
+ ];
425
+ for (const key of iamKeys) {
426
+ const value = config[key] || '(未配置)';
427
+ const displayValue = key.includes('PASSWORD') && value !== '(未配置)' ? '********' : value;
428
+ logger_1.logger.info(` ${formatKeyName(key)}: ${displayValue}`);
429
+ }
430
+ logger_1.logger.info('\n【CodeArts 配置】');
431
+ const codeartsKeys = [
432
+ types_1.ConfigKey.CODEARTS_BASE_URL,
433
+ types_1.ConfigKey.PROJECT_ID,
434
+ types_1.ConfigKey.ROLE_ID,
435
+ ];
436
+ for (const key of codeartsKeys) {
437
+ const value = config[key] || '(未配置)';
438
+ logger_1.logger.info(` ${formatKeyName(key)}: ${value}`);
439
+ }
440
+ }
441
+ /**
442
+ * 格式化配置项名称(用于显示)
443
+ */
444
+ function formatKeyName(key) {
445
+ const nameMap = {
446
+ [types_1.ConfigKey.HUAWEI_CLOUD_IAM_ENDPOINT]: 'IAM 认证端点',
447
+ [types_1.ConfigKey.HUAWEI_CLOUD_REGION]: '华为云区域',
448
+ [types_1.ConfigKey.HUAWEI_CLOUD_USERNAME]: 'IAM 用户名',
449
+ [types_1.ConfigKey.HUAWEI_CLOUD_PASSWORD]: 'IAM 密码',
450
+ [types_1.ConfigKey.HUAWEI_CLOUD_DOMAIN]: '华为云账号名',
451
+ [types_1.ConfigKey.CODEARTS_BASE_URL]: 'CodeArts API 地址',
452
+ [types_1.ConfigKey.PROJECT_ID]: '项目 ID',
453
+ [types_1.ConfigKey.ROLE_ID]: '角色 ID',
454
+ };
455
+ return nameMap[key] || key;
109
456
  }
@@ -1,9 +1,4 @@
1
- import { BusinessService } from '../services/business.service';
2
1
  import { CliOptions } from '../utils/config-loader';
3
- /**
4
- * 生成单个角色的日报
5
- */
6
- export declare function generateDailyReport(businessService: BusinessService, projectId: string, roleId: number, targetDate: string): Promise<void>;
7
2
  /**
8
3
  * daily 命令入口
9
4
  */