foco-cli 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -130
- package/dist/commands/ai-config.d.ts +7 -0
- package/dist/commands/ai-config.d.ts.map +1 -0
- package/dist/commands/ai-config.js +25 -0
- package/dist/commands/ai-config.js.map +1 -0
- package/dist/commands/cfa-knowledge-points.d.ts +25 -0
- package/dist/commands/cfa-knowledge-points.d.ts.map +1 -0
- package/dist/commands/{knowledge-points.js → cfa-knowledge-points.js} +11 -19
- package/dist/commands/cfa-knowledge-points.js.map +1 -0
- package/dist/commands/cfa-levels.d.ts +20 -0
- package/dist/commands/cfa-levels.d.ts.map +1 -0
- package/dist/commands/{exam-subjects.js → cfa-levels.js} +11 -11
- package/dist/commands/cfa-levels.js.map +1 -0
- package/dist/commands/cfa-modules.d.ts +20 -0
- package/dist/commands/cfa-modules.d.ts.map +1 -0
- package/dist/commands/{exam-levels.js → cfa-modules.js} +11 -11
- package/dist/commands/cfa-modules.js.map +1 -0
- package/dist/commands/cfa-subjects.d.ts +20 -0
- package/dist/commands/{exam-modules.d.ts.map → cfa-subjects.d.ts.map} +1 -1
- package/dist/commands/{exam-modules.js → cfa-subjects.js} +11 -11
- package/dist/commands/{exam-modules.js.map → cfa-subjects.js.map} +1 -1
- package/dist/commands/iiqe-sections.d.ts +13 -0
- package/dist/commands/iiqe-sections.d.ts.map +1 -0
- package/dist/commands/iiqe-sections.js +46 -0
- package/dist/commands/iiqe-sections.js.map +1 -0
- package/dist/commands/iiqe-syllabi.d.ts +14 -0
- package/dist/commands/iiqe-syllabi.d.ts.map +1 -0
- package/dist/commands/iiqe-syllabi.js +33 -0
- package/dist/commands/iiqe-syllabi.js.map +1 -0
- package/dist/commands/iiqe-units.d.ts +21 -0
- package/dist/commands/iiqe-units.d.ts.map +1 -0
- package/dist/commands/iiqe-units.js +49 -0
- package/dist/commands/iiqe-units.js.map +1 -0
- package/dist/commands/questions.d.ts +1 -1
- package/dist/commands/questions.js +1 -1
- package/dist/index.js +149 -153
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +72 -18
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/app/admin/questions/[questionId]/edit/page.d.ts +0 -1
- package/dist/app/admin/questions/[questionId]/edit/page.d.ts.map +0 -1
- package/dist/app/admin/questions/[questionId]/edit/page.js +0 -2
- package/dist/app/admin/questions/[questionId]/edit/page.js.map +0 -1
- package/dist/commands/banks.d.ts +0 -9
- package/dist/commands/banks.d.ts.map +0 -1
- package/dist/commands/banks.js +0 -18
- package/dist/commands/banks.js.map +0 -1
- package/dist/commands/cc-connect.d.ts +0 -8
- package/dist/commands/cc-connect.d.ts.map +0 -1
- package/dist/commands/cc-connect.js +0 -27
- package/dist/commands/cc-connect.js.map +0 -1
- package/dist/commands/exam-levels.d.ts +0 -20
- package/dist/commands/exam-levels.d.ts.map +0 -1
- package/dist/commands/exam-levels.js.map +0 -1
- package/dist/commands/exam-modules.d.ts +0 -20
- package/dist/commands/exam-subjects.d.ts +0 -20
- package/dist/commands/exam-subjects.d.ts.map +0 -1
- package/dist/commands/exam-subjects.js.map +0 -1
- package/dist/commands/knowledge-points.d.ts +0 -29
- package/dist/commands/knowledge-points.d.ts.map +0 -1
- package/dist/commands/knowledge-points.js.map +0 -1
- package/dist/commands/resource-packs.d.ts +0 -26
- package/dist/commands/resource-packs.d.ts.map +0 -1
- package/dist/commands/resource-packs.js +0 -64
- package/dist/commands/resource-packs.js.map +0 -1
- package/dist/commands/syllabi.d.ts +0 -26
- package/dist/commands/syllabi.d.ts.map +0 -1
- package/dist/commands/syllabi.js +0 -65
- package/dist/commands/syllabi.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -11,17 +11,15 @@ function mergeBody(opts) {
|
|
|
11
11
|
return opts;
|
|
12
12
|
}
|
|
13
13
|
import { handleLogin, handleStatus, handleLogout } from "./commands/login.js";
|
|
14
|
-
import { handleBanksList, handleBankShow } from "./commands/banks.js";
|
|
15
14
|
import { handleQuestionsList, handleQuestionShow, handleQuestionUpdateTitle } from "./commands/questions.js";
|
|
16
15
|
import { handleQuestionsFormat } from "./commands/questions-format.js";
|
|
17
16
|
import { handleIssuesList, handleIssueShow, handleIssueCreate, handleIssueUpdate, handleIssueComment, handleIssueComments, handleIssueCommentUpdate, handleIssueCommentDelete } from "./commands/issues.js";
|
|
18
17
|
import { handleEpicsList, handleEpicShow, handleEpicCreate, handleEpicUpdate } from "./commands/epics.js";
|
|
19
18
|
import { handleChangelogsList, handleChangelogCreate, handleChangelogUpdate } from "./commands/changelogs.js";
|
|
20
19
|
import { handleExamsList, handleExamShow, handleExamCreate, handleExamUpdate, handleExamDelete } from "./commands/exams.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { handleSyllabiList, handleSyllabusShow, handleSyllabusCreate, handleSyllabusUpdate, handleSyllabusDelete } from "./commands/syllabi.js";
|
|
20
|
+
import { handleCfaLevelsList, handleCfaLevelShow, handleCfaLevelCreate, handleCfaLevelUpdate, handleCfaLevelDelete } from "./commands/cfa-levels.js";
|
|
21
|
+
import { handleCfaSubjectsList, handleCfaSubjectShow, handleCfaSubjectCreate, handleCfaSubjectUpdate, handleCfaSubjectDelete } from "./commands/cfa-subjects.js";
|
|
22
|
+
import { handleCfaModulesList, handleCfaModuleShow, handleCfaModuleCreate, handleCfaModuleUpdate, handleCfaModuleDelete } from "./commands/cfa-modules.js";
|
|
25
23
|
import { handleUsersList } from "./commands/users.js";
|
|
26
24
|
import { handleOrdersList } from "./commands/orders.js";
|
|
27
25
|
import { handleProductsList, handleProductShow, handleProductCreate, handleProductUpdate, handleProductDelete } from "./commands/products.js";
|
|
@@ -30,15 +28,18 @@ import { handleThreadsList, handleThreadShow, handleThreadUpdate, handleThreadRe
|
|
|
30
28
|
import { handleFeedbackList, handleFeedbackShow, handleFeedbackCreate, handleFeedbackUpdate } from "./commands/feedback.js";
|
|
31
29
|
import { handleStats } from "./commands/stats.js";
|
|
32
30
|
import { handleDashboardOverview, handleDashboardLearning, handleDashboardProducts } from "./commands/dashboard.js";
|
|
33
|
-
import {
|
|
31
|
+
import { handleCfaKnowledgePointsList, handleCfaKnowledgePointCreate, handleCfaKnowledgePointUpdate, handleCfaKnowledgePointDelete } from "./commands/cfa-knowledge-points.js";
|
|
34
32
|
import { handleHelpArticlesList, handleHelpArticleShow, handleHelpArticleCreate, handleHelpArticleUpdate, handleHelpArticleDelete } from "./commands/help-articles.js";
|
|
35
33
|
import { handleKnowledgeBaseList, handleKnowledgeBaseShow, handleKnowledgeBaseCreate, handleKnowledgeBaseUpdate, handleKnowledgeBaseDelete } from "./commands/knowledge-base.js";
|
|
36
34
|
import { handleActivationCodesList, handleActivationCodeBatchCreate } from "./commands/activation-codes.js";
|
|
37
|
-
import { handleResourcePacksList, handleResourcePackShow, handleResourcePackCreate, handleResourcePackUpdate, handleResourcePackDelete } from "./commands/resource-packs.js";
|
|
38
35
|
import { handleAdminsList, handleAdminShow, handleAdminCreate, handleAdminUpdate, handleAdminDisable, handleAdminEnable } from "./commands/admins.js";
|
|
39
36
|
import { handleHuddlesList, handleHuddleShow, handleHuddleCreate, handleHuddleUpdate, handleHuddleDelete } from "./commands/huddles.js";
|
|
40
37
|
import { handleOpenCodeServerGet, handleOpenCodeServerSet } from "./commands/opencode-server.js";
|
|
38
|
+
import { handleAiConfigGet, handleAiConfigSet } from "./commands/ai-config.js";
|
|
41
39
|
import { handlePromptGroupsList, handlePromptGroupShow, handlePromptGroupCreate, handlePromptGroupUpdate, handlePromptGroupDelete, handlePromptTemplatesList, handlePromptTemplateShow, handlePromptTemplateCreate, handlePromptTemplateUpdate, handlePromptTemplateDelete, } from "./commands/prompt-templates.js";
|
|
40
|
+
import { handleIiqeUnitsList, handleIiqeUnitShow, handleIiqeUnitCreate, handleIiqeUnitUpdate, handleIiqeUnitDelete } from "./commands/iiqe-units.js";
|
|
41
|
+
import { handleIiqeSyllabiList, handleIiqeSyllabusShow, handleIiqeSyllabusUpdate, handleIiqeSyllabusDelete } from "./commands/iiqe-syllabi.js";
|
|
42
|
+
import { handleIiqeSectionsList, handleIiqeSectionShow, handleIiqeSectionUpdate, handleIiqeSectionDelete } from "./commands/iiqe-sections.js";
|
|
42
43
|
import { checkForUpdate, fetchLatestVersion, upgradeCli } from "./lib/version-check.js";
|
|
43
44
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
44
45
|
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
@@ -89,23 +90,10 @@ program
|
|
|
89
90
|
.action(async () => {
|
|
90
91
|
await handleStatus();
|
|
91
92
|
});
|
|
92
|
-
// ── Banks (题库) ──────────────────────────────────────────────
|
|
93
|
-
const banks = program.command("banks").description("题库管理");
|
|
94
|
-
banks.command("list").description("查看题库列表")
|
|
95
|
-
.option("--status <status>", "按状态筛选 (draft|published|archived)")
|
|
96
|
-
.option("--exam-id <id>", "按考试筛选 (用 exams list 查看 ID)")
|
|
97
|
-
.option("--keyword <keyword>", "按名称关键词搜索")
|
|
98
|
-
.option("--page <page>", "页码", "1")
|
|
99
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
100
|
-
.alias("ls")
|
|
101
|
-
.action(async (o) => { await handleBanksList(o); });
|
|
102
|
-
banks.command("show <bankId>").description("查看题库详情")
|
|
103
|
-
.alias("get")
|
|
104
|
-
.action(async (id) => { await handleBankShow(id); });
|
|
105
93
|
// ── Questions (题目) ──────────────────────────────────────────
|
|
106
94
|
const questions = program.command("questions").description("题目管理");
|
|
107
95
|
questions.command("list").description("查看题目列表")
|
|
108
|
-
.option("--
|
|
96
|
+
.option("--exam-id <id>", "按考试筛选 (用 exams list 查看 ID)")
|
|
109
97
|
.option("--type <type>", "按题型筛选 (single_choice|multiple_choice|true_false|fill_blank|short_answer)")
|
|
110
98
|
.option("--difficulty <level>", "按难度筛选 (1-5)")
|
|
111
99
|
.option("--keyword <keyword>", "按题干关键词搜索")
|
|
@@ -279,128 +267,94 @@ exams.command("update <id>").description("更新考试")
|
|
|
279
267
|
.alias("edit")
|
|
280
268
|
.action(async (id, o) => { await handleExamUpdate(id, o); });
|
|
281
269
|
exams.command("delete <id>").description("删除考试")
|
|
282
|
-
.option("--cascade", "
|
|
270
|
+
.option("--cascade", "级联删除关联数据(题目、练习记录等)")
|
|
283
271
|
.option("-f, --force", "跳过确认提示")
|
|
284
272
|
.alias("rm")
|
|
285
273
|
.action(async (id, o) => { await handleExamDelete(id, o); });
|
|
286
|
-
// ──
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
.requiredOption("--exam-id <id>", "考试 ID
|
|
274
|
+
// ── CFA Levels (CFA 等级) ──────────────────────────────────────
|
|
275
|
+
const cfaLevels = program.command("cfa-levels").description("CFA 等级管理");
|
|
276
|
+
cfaLevels.command("list").description("查看 CFA 等级列表")
|
|
277
|
+
.requiredOption("--exam-id <id>", "考试 ID (用 exams list 查看)")
|
|
290
278
|
.alias("ls")
|
|
291
|
-
.action(async (o) => { await
|
|
292
|
-
|
|
279
|
+
.action(async (o) => { await handleCfaLevelsList(o); });
|
|
280
|
+
cfaLevels.command("show <id>").description("查看等级详情")
|
|
293
281
|
.alias("get")
|
|
294
|
-
.action(async (id) => { await
|
|
295
|
-
|
|
296
|
-
.requiredOption("--exam-id <id>", "考试 ID
|
|
282
|
+
.action(async (id) => { await handleCfaLevelShow(id); });
|
|
283
|
+
cfaLevels.command("create").description("创建等级")
|
|
284
|
+
.requiredOption("--exam-id <id>", "考试 ID")
|
|
297
285
|
.requiredOption("--code <code>", "等级编码")
|
|
298
286
|
.requiredOption("--name <name>", "等级名称")
|
|
299
287
|
.option("--description <desc>", "描述")
|
|
300
288
|
.option("--sort-order <n>", "排序")
|
|
301
289
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
302
290
|
.alias("new")
|
|
303
|
-
.action(async (o) => { await
|
|
304
|
-
|
|
291
|
+
.action(async (o) => { await handleCfaLevelCreate(o); });
|
|
292
|
+
cfaLevels.command("update <id>").description("更新等级")
|
|
305
293
|
.option("--name <name>", "等级名称")
|
|
306
294
|
.option("--description <desc>", "描述")
|
|
307
295
|
.option("--sort-order <n>", "排序")
|
|
308
296
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
309
297
|
.alias("edit")
|
|
310
|
-
.action(async (id, o) => { await
|
|
311
|
-
|
|
298
|
+
.action(async (id, o) => { await handleCfaLevelUpdate(id, o); });
|
|
299
|
+
cfaLevels.command("delete <id>").description("删除等级")
|
|
312
300
|
.alias("rm")
|
|
313
|
-
.action(async (id) => { await
|
|
314
|
-
// ──
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
.requiredOption("--level-id <id>", "
|
|
301
|
+
.action(async (id) => { await handleCfaLevelDelete(id); });
|
|
302
|
+
// ── CFA Subjects (CFA 科目) ───────────────────────────────────────
|
|
303
|
+
const cfaSubjects = program.command("cfa-subjects").description("CFA 科目管理");
|
|
304
|
+
cfaSubjects.command("list").description("查看科目列表")
|
|
305
|
+
.requiredOption("--level-id <id>", "等级 ID (用 cfa-levels list 查看)")
|
|
318
306
|
.alias("ls")
|
|
319
|
-
.action(async (o) => { await
|
|
320
|
-
|
|
307
|
+
.action(async (o) => { await handleCfaSubjectsList(o); });
|
|
308
|
+
cfaSubjects.command("show <id>").description("查看科目详情")
|
|
321
309
|
.alias("get")
|
|
322
|
-
.action(async (id) => { await
|
|
323
|
-
|
|
324
|
-
.requiredOption("--level-id <id>", "
|
|
310
|
+
.action(async (id) => { await handleCfaSubjectShow(id); });
|
|
311
|
+
cfaSubjects.command("create").description("创建科目")
|
|
312
|
+
.requiredOption("--level-id <id>", "等级 ID")
|
|
325
313
|
.requiredOption("--code <code>", "科目编码")
|
|
326
314
|
.requiredOption("--name <name>", "科目名称")
|
|
327
315
|
.option("--description <desc>", "描述")
|
|
328
316
|
.option("--sort-order <n>", "排序")
|
|
329
317
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
330
318
|
.alias("new")
|
|
331
|
-
.action(async (o) => { await
|
|
332
|
-
|
|
319
|
+
.action(async (o) => { await handleCfaSubjectCreate(o); });
|
|
320
|
+
cfaSubjects.command("update <id>").description("更新科目")
|
|
333
321
|
.option("--name <name>", "科目名称")
|
|
334
322
|
.option("--description <desc>", "描述")
|
|
335
323
|
.option("--sort-order <n>", "排序")
|
|
336
324
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
337
325
|
.alias("edit")
|
|
338
|
-
.action(async (id, o) => { await
|
|
339
|
-
|
|
326
|
+
.action(async (id, o) => { await handleCfaSubjectUpdate(id, o); });
|
|
327
|
+
cfaSubjects.command("delete <id>").description("删除科目")
|
|
340
328
|
.alias("rm")
|
|
341
|
-
.action(async (id) => { await
|
|
342
|
-
// ──
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
.requiredOption("--subject-id <id>", "科目 ID
|
|
329
|
+
.action(async (id) => { await handleCfaSubjectDelete(id); });
|
|
330
|
+
// ── CFA Modules (CFA 学习模块) ──────────────────────────────────────
|
|
331
|
+
const cfaModules = program.command("cfa-modules").description("CFA 学习模块管理");
|
|
332
|
+
cfaModules.command("list").description("查看 Module 列表")
|
|
333
|
+
.requiredOption("--subject-id <id>", "科目 ID (用 cfa-subjects list 查看)")
|
|
346
334
|
.alias("ls")
|
|
347
|
-
.action(async (o) => { await
|
|
348
|
-
|
|
335
|
+
.action(async (o) => { await handleCfaModulesList(o); });
|
|
336
|
+
cfaModules.command("show <id>").description("查看 Module 详情")
|
|
349
337
|
.alias("get")
|
|
350
|
-
.action(async (id) => { await
|
|
351
|
-
|
|
352
|
-
.requiredOption("--subject-id <id>", "科目 ID
|
|
338
|
+
.action(async (id) => { await handleCfaModuleShow(id); });
|
|
339
|
+
cfaModules.command("create").description("创建 Module")
|
|
340
|
+
.requiredOption("--subject-id <id>", "科目 ID")
|
|
353
341
|
.requiredOption("--code <code>", "Module 编码")
|
|
354
342
|
.requiredOption("--name <name>", "Module 名称")
|
|
355
343
|
.option("--description <desc>", "描述")
|
|
356
344
|
.option("--sort-order <n>", "排序")
|
|
357
345
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
358
346
|
.alias("new")
|
|
359
|
-
.action(async (o) => { await
|
|
360
|
-
|
|
347
|
+
.action(async (o) => { await handleCfaModuleCreate(o); });
|
|
348
|
+
cfaModules.command("update <id>").description("更新 Module")
|
|
361
349
|
.option("--name <name>", "Module 名称")
|
|
362
350
|
.option("--description <desc>", "描述")
|
|
363
351
|
.option("--sort-order <n>", "排序")
|
|
364
352
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
365
353
|
.alias("edit")
|
|
366
|
-
.action(async (id, o) => { await
|
|
367
|
-
|
|
354
|
+
.action(async (id, o) => { await handleCfaModuleUpdate(id, o); });
|
|
355
|
+
cfaModules.command("delete <id>").description("删除 Module")
|
|
368
356
|
.alias("rm")
|
|
369
|
-
.action(async (id) => { await
|
|
370
|
-
// ── Syllabi (大纲) ────────────────────────────────────────────
|
|
371
|
-
const syllabi = program.command("syllabi").description("大纲管理");
|
|
372
|
-
syllabi.command("list").description("查看大纲列表")
|
|
373
|
-
.option("--exam-id <id>", "按考试筛选")
|
|
374
|
-
.option("--page <page>", "页码", "1")
|
|
375
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
376
|
-
.alias("ls")
|
|
377
|
-
.action(async (o) => { await handleSyllabiList(o); });
|
|
378
|
-
syllabi.command("show <id>").description("查看大纲详情")
|
|
379
|
-
.alias("get")
|
|
380
|
-
.action(async (id) => { await handleSyllabusShow(id); });
|
|
381
|
-
syllabi.command("create").description("创建大纲")
|
|
382
|
-
.requiredOption("--exam-id <id>", "考试 ID")
|
|
383
|
-
.requiredOption("--name <name>", "大纲名称")
|
|
384
|
-
.option("--version-label <label>", "版本标签")
|
|
385
|
-
.option("--description <desc>", "描述")
|
|
386
|
-
.option("--sort-order <n>", "排序")
|
|
387
|
-
.option("--is-trial <bool>", "是否试用 (true/false)")
|
|
388
|
-
.option("--is-active <bool>", "是否启用 (true/false)")
|
|
389
|
-
.alias("new")
|
|
390
|
-
.action(async (o) => { await handleSyllabusCreate(o); });
|
|
391
|
-
syllabi.command("update <id>").description("更新大纲")
|
|
392
|
-
.option("--exam-id <id>", "考试 ID")
|
|
393
|
-
.option("--name <name>", "大纲名称")
|
|
394
|
-
.option("--version-label <label>", "版本标签")
|
|
395
|
-
.option("--description <desc>", "描述")
|
|
396
|
-
.option("--sort-order <n>", "排序")
|
|
397
|
-
.option("--is-trial <bool>", "是否试用")
|
|
398
|
-
.option("--is-active <bool>", "是否启用")
|
|
399
|
-
.alias("edit")
|
|
400
|
-
.action(async (id, o) => { await handleSyllabusUpdate(id, o); });
|
|
401
|
-
syllabi.command("delete <id>").description("删除大纲")
|
|
402
|
-
.alias("rm")
|
|
403
|
-
.action(async (id) => { await handleSyllabusDelete(id); });
|
|
357
|
+
.action(async (id) => { await handleCfaModuleDelete(id); });
|
|
404
358
|
// ── Users (用户) ──────────────────────────────────────────────
|
|
405
359
|
program.command("users").description("用户管理")
|
|
406
360
|
.command("list").description("查看用户列表")
|
|
@@ -424,7 +378,7 @@ program.command("orders").description("订单管理")
|
|
|
424
378
|
// ── Products (商品) ───────────────────────────────────────────
|
|
425
379
|
const products = program.command("products").description("商品管理");
|
|
426
380
|
products.command("list").description("查看商品列表")
|
|
427
|
-
.option("--product-type <type>", "按类型筛选 (
|
|
381
|
+
.option("--product-type <type>", "按类型筛选 (exam_level|iiqe_unit)")
|
|
428
382
|
.option("--status <status>", "按状态筛选")
|
|
429
383
|
.option("--keyword <keyword>", "搜索标题")
|
|
430
384
|
.option("--page <page>", "页码", "1")
|
|
@@ -435,8 +389,8 @@ products.command("show <id>").description("查看商品详情")
|
|
|
435
389
|
.alias("get")
|
|
436
390
|
.action(async (id) => { await handleProductShow(id); });
|
|
437
391
|
products.command("create").description("创建商品")
|
|
438
|
-
.requiredOption("--product-type <type>", "类型 (
|
|
439
|
-
.requiredOption("--ref-id <id>", "关联资源 ID (
|
|
392
|
+
.requiredOption("--product-type <type>", "类型 (exam_level|iiqe_unit)")
|
|
393
|
+
.requiredOption("--ref-id <id>", "关联资源 ID (等级 ID 或单元 ID)")
|
|
440
394
|
.requiredOption("--title <title>", "商品标题")
|
|
441
395
|
.option("--cover-url <url>", "封面 URL")
|
|
442
396
|
.option("--status <status>", "状态 (active|inactive)")
|
|
@@ -525,32 +479,28 @@ feedback.command("update <number>").description("更新反馈")
|
|
|
525
479
|
.option("--labels <labels>", "标签(逗号分隔)")
|
|
526
480
|
.alias("edit")
|
|
527
481
|
.action(async (num, o) => { await handleFeedbackUpdate(num, o); });
|
|
528
|
-
// ── Knowledge Points (
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
.option("--
|
|
482
|
+
// ── CFA Knowledge Points (CFA 考点) ─────────────────────────────────
|
|
483
|
+
const cfaKps = program.command("cfa-knowledge-points").description("CFA 考点管理");
|
|
484
|
+
cfaKps.command("list").description("查看考点列表")
|
|
485
|
+
.option("--exam-id <id>", "按考试筛选")
|
|
532
486
|
.option("--type <type>", "按类型筛选")
|
|
533
487
|
.option("--status <status>", "按状态筛选")
|
|
534
488
|
.option("--keyword <keyword>", "搜索标题")
|
|
535
489
|
.option("--page <page>", "页码", "1")
|
|
536
490
|
.option("--page-size <size>", "每页数量", "20")
|
|
537
491
|
.alias("ls")
|
|
538
|
-
.action(async (o) => { await
|
|
539
|
-
|
|
540
|
-
.requiredOption("--
|
|
492
|
+
.action(async (o) => { await handleCfaKnowledgePointsList(o); });
|
|
493
|
+
cfaKps.command("create").description("创建考点")
|
|
494
|
+
.requiredOption("--exam-id <id>", "考试 ID")
|
|
541
495
|
.requiredOption("--type <type>", "类型 (qa|knowledge|summary_note)")
|
|
542
496
|
.requiredOption("--title <title>", "标题")
|
|
543
497
|
.requiredOption("--content <content>", "内容")
|
|
544
498
|
.option("--body <content>", "内容(--content 的别名)")
|
|
545
|
-
.option("--syllabus-id <id>", "大纲 ID")
|
|
546
|
-
.option("--section-id <id>", "章节 ID")
|
|
547
499
|
.option("--sort-order <n>", "排序")
|
|
548
500
|
.option("--status <status>", "状态 (draft|published|archived)")
|
|
549
501
|
.alias("new")
|
|
550
|
-
.action(async (o) => { await
|
|
551
|
-
|
|
552
|
-
.option("--syllabus-id <id>", "大纲 ID")
|
|
553
|
-
.option("--section-id <id>", "章节 ID")
|
|
502
|
+
.action(async (o) => { await handleCfaKnowledgePointCreate(mergeBody(o)); });
|
|
503
|
+
cfaKps.command("update <id>").description("更新考点")
|
|
554
504
|
.option("--type <type>", "类型 (qa|knowledge|summary_note)")
|
|
555
505
|
.option("--title <title>", "标题")
|
|
556
506
|
.option("--content <content>", "内容")
|
|
@@ -558,10 +508,10 @@ kps.command("update <id>").description("更新知识点")
|
|
|
558
508
|
.option("--sort-order <n>", "排序")
|
|
559
509
|
.option("--status <status>", "状态 (draft|published|archived)")
|
|
560
510
|
.alias("edit")
|
|
561
|
-
.action(async (id, o) => { await
|
|
562
|
-
|
|
511
|
+
.action(async (id, o) => { await handleCfaKnowledgePointUpdate(id, mergeBody(o)); });
|
|
512
|
+
cfaKps.command("delete <id>").description("删除考点")
|
|
563
513
|
.alias("rm")
|
|
564
|
-
.action(async (id) => { await
|
|
514
|
+
.action(async (id) => { await handleCfaKnowledgePointDelete(id); });
|
|
565
515
|
// ── Help Articles (帮助文章) ──────────────────────────────────
|
|
566
516
|
const helpArticles = program.command("help-articles").description("帮助文章管理");
|
|
567
517
|
helpArticles.command("list").description("查看文章列表")
|
|
@@ -655,40 +605,6 @@ activationCodes.command("create-batch").description("批量生成激活码")
|
|
|
655
605
|
.option("--expires-at <date>", "过期时间 (ISO 日期)")
|
|
656
606
|
.alias("new")
|
|
657
607
|
.action(async (o) => { await handleActivationCodeBatchCreate(o); });
|
|
658
|
-
// ── Resource Packs (资源包) ───────────────────────────────────
|
|
659
|
-
const resourcePacks = program.command("resource-packs").description("资源包管理");
|
|
660
|
-
resourcePacks.command("list").description("查看资源包列表")
|
|
661
|
-
.option("--status <status>", "按状态筛选")
|
|
662
|
-
.option("--bank-id <id>", "按题库筛选")
|
|
663
|
-
.option("--keyword <keyword>", "搜索标题")
|
|
664
|
-
.option("--page <page>", "页码", "1")
|
|
665
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
666
|
-
.alias("ls")
|
|
667
|
-
.action(async (o) => { await handleResourcePacksList(o); });
|
|
668
|
-
resourcePacks.command("show <id>").description("查看资源包详情")
|
|
669
|
-
.alias("get")
|
|
670
|
-
.action(async (id) => { await handleResourcePackShow(id); });
|
|
671
|
-
resourcePacks.command("create").description("创建资源包")
|
|
672
|
-
.requiredOption("--title <title>", "标题")
|
|
673
|
-
.option("--bank-id <id>", "题库 ID")
|
|
674
|
-
.option("--cover-url <url>", "封面 URL")
|
|
675
|
-
.option("--description <desc>", "描述")
|
|
676
|
-
.option("--status <status>", "状态")
|
|
677
|
-
.option("--sort-order <n>", "排序")
|
|
678
|
-
.alias("new")
|
|
679
|
-
.action(async (o) => { await handleResourcePackCreate(o); });
|
|
680
|
-
resourcePacks.command("update <id>").description("更新资源包")
|
|
681
|
-
.option("--title <title>", "标题")
|
|
682
|
-
.option("--bank-id <id>", "题库 ID")
|
|
683
|
-
.option("--cover-url <url>", "封面 URL")
|
|
684
|
-
.option("--description <desc>", "描述")
|
|
685
|
-
.option("--status <status>", "状态")
|
|
686
|
-
.option("--sort-order <n>", "排序")
|
|
687
|
-
.alias("edit")
|
|
688
|
-
.action(async (id, o) => { await handleResourcePackUpdate(id, o); });
|
|
689
|
-
resourcePacks.command("delete <id>").description("删除资源包")
|
|
690
|
-
.alias("rm")
|
|
691
|
-
.action(async (id) => { await handleResourcePackDelete(id); });
|
|
692
608
|
// ── Admins (管理员) ───────────────────────────────────────────
|
|
693
609
|
const admins = program.command("admins").description("管理员管理");
|
|
694
610
|
admins.command("list").description("查看管理员列表")
|
|
@@ -712,6 +628,76 @@ admins.command("disable <id>").description("禁用管理员")
|
|
|
712
628
|
.action(async (id) => { await handleAdminDisable(id); });
|
|
713
629
|
admins.command("enable <id>").description("启用管理员")
|
|
714
630
|
.action(async (id) => { await handleAdminEnable(id); });
|
|
631
|
+
// ── IIQE Units (IIQE 卷) ───────────────────────────────────────
|
|
632
|
+
const iiqeUnits = program.command("iiqe-units").description("IIQE 卷管理");
|
|
633
|
+
iiqeUnits.command("list").description("查看卷列表")
|
|
634
|
+
.requiredOption("--exam-id <id>", "考试 ID (用 exams list 查看)")
|
|
635
|
+
.alias("ls")
|
|
636
|
+
.action(async (o) => { await handleIiqeUnitsList(o); });
|
|
637
|
+
iiqeUnits.command("show <id>").description("查看卷详情")
|
|
638
|
+
.alias("get")
|
|
639
|
+
.action(async (id) => { await handleIiqeUnitShow(id); });
|
|
640
|
+
iiqeUnits.command("create").description("创建卷")
|
|
641
|
+
.requiredOption("--exam-id <id>", "考试 ID")
|
|
642
|
+
.requiredOption("--code <code>", "卷编码")
|
|
643
|
+
.requiredOption("--name <name>", "卷名称")
|
|
644
|
+
.option("--description <desc>", "描述")
|
|
645
|
+
.option("--sort-order <n>", "排序")
|
|
646
|
+
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
647
|
+
.alias("new")
|
|
648
|
+
.action(async (o) => { await handleIiqeUnitCreate(o); });
|
|
649
|
+
iiqeUnits.command("update <id>").description("更新卷")
|
|
650
|
+
.option("--name <name>", "卷名称")
|
|
651
|
+
.option("--description <desc>", "描述")
|
|
652
|
+
.option("--sort-order <n>", "排序")
|
|
653
|
+
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
654
|
+
.option("--required-product-id <id>", "关联产品 ID")
|
|
655
|
+
.alias("edit")
|
|
656
|
+
.action(async (id, o) => { await handleIiqeUnitUpdate(id, o); });
|
|
657
|
+
iiqeUnits.command("delete <id>").description("删除卷")
|
|
658
|
+
.alias("rm")
|
|
659
|
+
.action(async (id) => { await handleIiqeUnitDelete(id); });
|
|
660
|
+
// ── IIQE Syllabi (IIQE 大纲) ───────────────────────────────────
|
|
661
|
+
const iiqeSyllabi = program.command("iiqe-syllabi").description("IIQE 大纲管理");
|
|
662
|
+
iiqeSyllabi.command("list").description("查看大纲列表")
|
|
663
|
+
.requiredOption("--unit-id <id>", "卷 ID (用 iiqe-units list 查看)")
|
|
664
|
+
.alias("ls")
|
|
665
|
+
.action(async (o) => { await handleIiqeSyllabiList(o); });
|
|
666
|
+
iiqeSyllabi.command("show <id>").description("查看大纲详情")
|
|
667
|
+
.alias("get")
|
|
668
|
+
.action(async (id) => { await handleIiqeSyllabusShow(id); });
|
|
669
|
+
iiqeSyllabi.command("update <id>").description("更新大纲")
|
|
670
|
+
.option("--name <name>", "大纲名称")
|
|
671
|
+
.option("--version-label <label>", "版本标签")
|
|
672
|
+
.option("--description <desc>", "描述")
|
|
673
|
+
.option("--sort-order <n>", "排序")
|
|
674
|
+
.option("--is-trial <bool>", "是否试用")
|
|
675
|
+
.option("--is-active <bool>", "是否激活")
|
|
676
|
+
.alias("edit")
|
|
677
|
+
.action(async (id, o) => { await handleIiqeSyllabusUpdate(id, o); });
|
|
678
|
+
iiqeSyllabi.command("delete <id>").description("删除大纲")
|
|
679
|
+
.alias("rm")
|
|
680
|
+
.action(async (id) => { await handleIiqeSyllabusDelete(id); });
|
|
681
|
+
// ── IIQE Sections (IIQE 章节) ──────────────────────────────────
|
|
682
|
+
const iiqeSections = program.command("iiqe-sections").description("IIQE 章节管理");
|
|
683
|
+
iiqeSections.command("list").description("查看章节列表")
|
|
684
|
+
.requiredOption("--syllabus-id <id>", "大纲 ID (用 iiqe-syllabi list 查看)")
|
|
685
|
+
.alias("ls")
|
|
686
|
+
.action(async (o) => { await handleIiqeSectionsList(o); });
|
|
687
|
+
iiqeSections.command("show <id>").description("查看章节详情")
|
|
688
|
+
.alias("get")
|
|
689
|
+
.action(async (id) => { await handleIiqeSectionShow(id); });
|
|
690
|
+
iiqeSections.command("update <id>").description("更新章节")
|
|
691
|
+
.option("--title <title>", "章节标题")
|
|
692
|
+
.option("--section-type <type>", "章节类型")
|
|
693
|
+
.option("--parent-id <id>", "父章节 ID")
|
|
694
|
+
.option("--sort-order <n>", "排序")
|
|
695
|
+
.option("--is-trial <bool>", "是否试用")
|
|
696
|
+
.alias("edit")
|
|
697
|
+
.action(async (id, o) => { await handleIiqeSectionUpdate(id, o); });
|
|
698
|
+
iiqeSections.command("delete <id>").description("删除章节")
|
|
699
|
+
.alias("rm")
|
|
700
|
+
.action(async (id) => { await handleIiqeSectionDelete(id); });
|
|
715
701
|
// ── Stats (统计) ──────────────────────────────────────────────
|
|
716
702
|
program.command("stats").description("查看统计数据")
|
|
717
703
|
.action(async () => { await handleStats(); });
|
|
@@ -751,7 +737,7 @@ dashboard.command("learning").description("学习数据")
|
|
|
751
737
|
.action(async (o) => { await handleDashboardLearning(o); });
|
|
752
738
|
dashboard.command("products").description("商品数据")
|
|
753
739
|
.option("--range <range>", "时间范围 (7d|30d)", "7d")
|
|
754
|
-
.option("--product-type <type>", "商品类型 (
|
|
740
|
+
.option("--product-type <type>", "商品类型 (exam_level|iiqe_unit)")
|
|
755
741
|
.action(async (o) => { await handleDashboardProducts(o); });
|
|
756
742
|
// ── OpenCode Server (集成配置) ──────────────────────────────────
|
|
757
743
|
const opencodeServer = program.command("opencode-server").description("OpenCode Server 集成配置");
|
|
@@ -764,6 +750,16 @@ opencodeServer.command("set").description("更新 OpenCode Server 配置")
|
|
|
764
750
|
.option("--project-path <path>", "项目路径")
|
|
765
751
|
.option("--enabled <bool>", "是否启用 (true/false)")
|
|
766
752
|
.action(async (o) => { await handleOpenCodeServerSet(o); });
|
|
753
|
+
// ── AI Config (AI 模型配置) ────────────────────────────────────
|
|
754
|
+
const aiConfig = program.command("ai-config").description("AI 模型配置");
|
|
755
|
+
aiConfig.command("get").description("查看 AI 配置")
|
|
756
|
+
.alias("show")
|
|
757
|
+
.action(async () => { await handleAiConfigGet(); });
|
|
758
|
+
aiConfig.command("set").description("更新 AI 配置")
|
|
759
|
+
.option("--api-key <key>", "API 密钥(留空字符串清除)")
|
|
760
|
+
.option("--base-url <url>", "API 地址")
|
|
761
|
+
.option("--model <model>", "模型名称")
|
|
762
|
+
.action(async (o) => { await handleAiConfigSet(o); });
|
|
767
763
|
// ── AI Prompt Templates (提示词模板) ──────────────────────────────
|
|
768
764
|
const promptGroups = program.command("prompt-groups").description("AI 提示词分组管理");
|
|
769
765
|
promptGroups.command("list").description("查看分组列表")
|
|
@@ -805,7 +801,7 @@ promptTemplates.command("show <id>").description("查看模板详情")
|
|
|
805
801
|
.action(async (id) => { await handlePromptTemplateShow(id); });
|
|
806
802
|
promptTemplates.command("create <groupId>").description("创建模板")
|
|
807
803
|
.requiredOption("--name <name>", "名称")
|
|
808
|
-
.option("--scope <scope>", "范围 (global|
|
|
804
|
+
.option("--scope <scope>", "范围 (global|module)", "global")
|
|
809
805
|
.option("--scope-id <id>", "范围 ID")
|
|
810
806
|
.option("--field-type <type>", "字段类型")
|
|
811
807
|
.option("--system-prompt <prompt>", "提示词内容")
|