foco-cli 0.10.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/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 +138 -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,16 +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";
|
|
41
38
|
import { handleAiConfigGet, handleAiConfigSet } from "./commands/ai-config.js";
|
|
42
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";
|
|
43
43
|
import { checkForUpdate, fetchLatestVersion, upgradeCli } from "./lib/version-check.js";
|
|
44
44
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
45
45
|
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
@@ -90,23 +90,10 @@ program
|
|
|
90
90
|
.action(async () => {
|
|
91
91
|
await handleStatus();
|
|
92
92
|
});
|
|
93
|
-
// ── Banks (题库) ──────────────────────────────────────────────
|
|
94
|
-
const banks = program.command("banks").description("题库管理");
|
|
95
|
-
banks.command("list").description("查看题库列表")
|
|
96
|
-
.option("--status <status>", "按状态筛选 (draft|published|archived)")
|
|
97
|
-
.option("--exam-id <id>", "按考试筛选 (用 exams list 查看 ID)")
|
|
98
|
-
.option("--keyword <keyword>", "按名称关键词搜索")
|
|
99
|
-
.option("--page <page>", "页码", "1")
|
|
100
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
101
|
-
.alias("ls")
|
|
102
|
-
.action(async (o) => { await handleBanksList(o); });
|
|
103
|
-
banks.command("show <bankId>").description("查看题库详情")
|
|
104
|
-
.alias("get")
|
|
105
|
-
.action(async (id) => { await handleBankShow(id); });
|
|
106
93
|
// ── Questions (题目) ──────────────────────────────────────────
|
|
107
94
|
const questions = program.command("questions").description("题目管理");
|
|
108
95
|
questions.command("list").description("查看题目列表")
|
|
109
|
-
.option("--
|
|
96
|
+
.option("--exam-id <id>", "按考试筛选 (用 exams list 查看 ID)")
|
|
110
97
|
.option("--type <type>", "按题型筛选 (single_choice|multiple_choice|true_false|fill_blank|short_answer)")
|
|
111
98
|
.option("--difficulty <level>", "按难度筛选 (1-5)")
|
|
112
99
|
.option("--keyword <keyword>", "按题干关键词搜索")
|
|
@@ -280,128 +267,94 @@ exams.command("update <id>").description("更新考试")
|
|
|
280
267
|
.alias("edit")
|
|
281
268
|
.action(async (id, o) => { await handleExamUpdate(id, o); });
|
|
282
269
|
exams.command("delete <id>").description("删除考试")
|
|
283
|
-
.option("--cascade", "
|
|
270
|
+
.option("--cascade", "级联删除关联数据(题目、练习记录等)")
|
|
284
271
|
.option("-f, --force", "跳过确认提示")
|
|
285
272
|
.alias("rm")
|
|
286
273
|
.action(async (id, o) => { await handleExamDelete(id, o); });
|
|
287
|
-
// ──
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
.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 查看)")
|
|
291
278
|
.alias("ls")
|
|
292
|
-
.action(async (o) => { await
|
|
293
|
-
|
|
279
|
+
.action(async (o) => { await handleCfaLevelsList(o); });
|
|
280
|
+
cfaLevels.command("show <id>").description("查看等级详情")
|
|
294
281
|
.alias("get")
|
|
295
|
-
.action(async (id) => { await
|
|
296
|
-
|
|
297
|
-
.requiredOption("--exam-id <id>", "考试 ID
|
|
282
|
+
.action(async (id) => { await handleCfaLevelShow(id); });
|
|
283
|
+
cfaLevels.command("create").description("创建等级")
|
|
284
|
+
.requiredOption("--exam-id <id>", "考试 ID")
|
|
298
285
|
.requiredOption("--code <code>", "等级编码")
|
|
299
286
|
.requiredOption("--name <name>", "等级名称")
|
|
300
287
|
.option("--description <desc>", "描述")
|
|
301
288
|
.option("--sort-order <n>", "排序")
|
|
302
289
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
303
290
|
.alias("new")
|
|
304
|
-
.action(async (o) => { await
|
|
305
|
-
|
|
291
|
+
.action(async (o) => { await handleCfaLevelCreate(o); });
|
|
292
|
+
cfaLevels.command("update <id>").description("更新等级")
|
|
306
293
|
.option("--name <name>", "等级名称")
|
|
307
294
|
.option("--description <desc>", "描述")
|
|
308
295
|
.option("--sort-order <n>", "排序")
|
|
309
296
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
310
297
|
.alias("edit")
|
|
311
|
-
.action(async (id, o) => { await
|
|
312
|
-
|
|
298
|
+
.action(async (id, o) => { await handleCfaLevelUpdate(id, o); });
|
|
299
|
+
cfaLevels.command("delete <id>").description("删除等级")
|
|
313
300
|
.alias("rm")
|
|
314
|
-
.action(async (id) => { await
|
|
315
|
-
// ──
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
.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 查看)")
|
|
319
306
|
.alias("ls")
|
|
320
|
-
.action(async (o) => { await
|
|
321
|
-
|
|
307
|
+
.action(async (o) => { await handleCfaSubjectsList(o); });
|
|
308
|
+
cfaSubjects.command("show <id>").description("查看科目详情")
|
|
322
309
|
.alias("get")
|
|
323
|
-
.action(async (id) => { await
|
|
324
|
-
|
|
325
|
-
.requiredOption("--level-id <id>", "
|
|
310
|
+
.action(async (id) => { await handleCfaSubjectShow(id); });
|
|
311
|
+
cfaSubjects.command("create").description("创建科目")
|
|
312
|
+
.requiredOption("--level-id <id>", "等级 ID")
|
|
326
313
|
.requiredOption("--code <code>", "科目编码")
|
|
327
314
|
.requiredOption("--name <name>", "科目名称")
|
|
328
315
|
.option("--description <desc>", "描述")
|
|
329
316
|
.option("--sort-order <n>", "排序")
|
|
330
317
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
331
318
|
.alias("new")
|
|
332
|
-
.action(async (o) => { await
|
|
333
|
-
|
|
319
|
+
.action(async (o) => { await handleCfaSubjectCreate(o); });
|
|
320
|
+
cfaSubjects.command("update <id>").description("更新科目")
|
|
334
321
|
.option("--name <name>", "科目名称")
|
|
335
322
|
.option("--description <desc>", "描述")
|
|
336
323
|
.option("--sort-order <n>", "排序")
|
|
337
324
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
338
325
|
.alias("edit")
|
|
339
|
-
.action(async (id, o) => { await
|
|
340
|
-
|
|
326
|
+
.action(async (id, o) => { await handleCfaSubjectUpdate(id, o); });
|
|
327
|
+
cfaSubjects.command("delete <id>").description("删除科目")
|
|
341
328
|
.alias("rm")
|
|
342
|
-
.action(async (id) => { await
|
|
343
|
-
// ──
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
.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 查看)")
|
|
347
334
|
.alias("ls")
|
|
348
|
-
.action(async (o) => { await
|
|
349
|
-
|
|
335
|
+
.action(async (o) => { await handleCfaModulesList(o); });
|
|
336
|
+
cfaModules.command("show <id>").description("查看 Module 详情")
|
|
350
337
|
.alias("get")
|
|
351
|
-
.action(async (id) => { await
|
|
352
|
-
|
|
353
|
-
.requiredOption("--subject-id <id>", "科目 ID
|
|
338
|
+
.action(async (id) => { await handleCfaModuleShow(id); });
|
|
339
|
+
cfaModules.command("create").description("创建 Module")
|
|
340
|
+
.requiredOption("--subject-id <id>", "科目 ID")
|
|
354
341
|
.requiredOption("--code <code>", "Module 编码")
|
|
355
342
|
.requiredOption("--name <name>", "Module 名称")
|
|
356
343
|
.option("--description <desc>", "描述")
|
|
357
344
|
.option("--sort-order <n>", "排序")
|
|
358
345
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
359
346
|
.alias("new")
|
|
360
|
-
.action(async (o) => { await
|
|
361
|
-
|
|
347
|
+
.action(async (o) => { await handleCfaModuleCreate(o); });
|
|
348
|
+
cfaModules.command("update <id>").description("更新 Module")
|
|
362
349
|
.option("--name <name>", "Module 名称")
|
|
363
350
|
.option("--description <desc>", "描述")
|
|
364
351
|
.option("--sort-order <n>", "排序")
|
|
365
352
|
.option("--is-visible <bool>", "是否可见 (true/false)")
|
|
366
353
|
.alias("edit")
|
|
367
|
-
.action(async (id, o) => { await
|
|
368
|
-
|
|
369
|
-
.alias("rm")
|
|
370
|
-
.action(async (id) => { await handleExamModuleDelete(id); });
|
|
371
|
-
// ── Syllabi (大纲) ────────────────────────────────────────────
|
|
372
|
-
const syllabi = program.command("syllabi").description("大纲管理");
|
|
373
|
-
syllabi.command("list").description("查看大纲列表")
|
|
374
|
-
.option("--exam-id <id>", "按考试筛选")
|
|
375
|
-
.option("--page <page>", "页码", "1")
|
|
376
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
377
|
-
.alias("ls")
|
|
378
|
-
.action(async (o) => { await handleSyllabiList(o); });
|
|
379
|
-
syllabi.command("show <id>").description("查看大纲详情")
|
|
380
|
-
.alias("get")
|
|
381
|
-
.action(async (id) => { await handleSyllabusShow(id); });
|
|
382
|
-
syllabi.command("create").description("创建大纲")
|
|
383
|
-
.requiredOption("--exam-id <id>", "考试 ID")
|
|
384
|
-
.requiredOption("--name <name>", "大纲名称")
|
|
385
|
-
.option("--version-label <label>", "版本标签")
|
|
386
|
-
.option("--description <desc>", "描述")
|
|
387
|
-
.option("--sort-order <n>", "排序")
|
|
388
|
-
.option("--is-trial <bool>", "是否试用 (true/false)")
|
|
389
|
-
.option("--is-active <bool>", "是否启用 (true/false)")
|
|
390
|
-
.alias("new")
|
|
391
|
-
.action(async (o) => { await handleSyllabusCreate(o); });
|
|
392
|
-
syllabi.command("update <id>").description("更新大纲")
|
|
393
|
-
.option("--exam-id <id>", "考试 ID")
|
|
394
|
-
.option("--name <name>", "大纲名称")
|
|
395
|
-
.option("--version-label <label>", "版本标签")
|
|
396
|
-
.option("--description <desc>", "描述")
|
|
397
|
-
.option("--sort-order <n>", "排序")
|
|
398
|
-
.option("--is-trial <bool>", "是否试用")
|
|
399
|
-
.option("--is-active <bool>", "是否启用")
|
|
400
|
-
.alias("edit")
|
|
401
|
-
.action(async (id, o) => { await handleSyllabusUpdate(id, o); });
|
|
402
|
-
syllabi.command("delete <id>").description("删除大纲")
|
|
354
|
+
.action(async (id, o) => { await handleCfaModuleUpdate(id, o); });
|
|
355
|
+
cfaModules.command("delete <id>").description("删除 Module")
|
|
403
356
|
.alias("rm")
|
|
404
|
-
.action(async (id) => { await
|
|
357
|
+
.action(async (id) => { await handleCfaModuleDelete(id); });
|
|
405
358
|
// ── Users (用户) ──────────────────────────────────────────────
|
|
406
359
|
program.command("users").description("用户管理")
|
|
407
360
|
.command("list").description("查看用户列表")
|
|
@@ -425,7 +378,7 @@ program.command("orders").description("订单管理")
|
|
|
425
378
|
// ── Products (商品) ───────────────────────────────────────────
|
|
426
379
|
const products = program.command("products").description("商品管理");
|
|
427
380
|
products.command("list").description("查看商品列表")
|
|
428
|
-
.option("--product-type <type>", "按类型筛选 (
|
|
381
|
+
.option("--product-type <type>", "按类型筛选 (exam_level|iiqe_unit)")
|
|
429
382
|
.option("--status <status>", "按状态筛选")
|
|
430
383
|
.option("--keyword <keyword>", "搜索标题")
|
|
431
384
|
.option("--page <page>", "页码", "1")
|
|
@@ -436,8 +389,8 @@ products.command("show <id>").description("查看商品详情")
|
|
|
436
389
|
.alias("get")
|
|
437
390
|
.action(async (id) => { await handleProductShow(id); });
|
|
438
391
|
products.command("create").description("创建商品")
|
|
439
|
-
.requiredOption("--product-type <type>", "类型 (
|
|
440
|
-
.requiredOption("--ref-id <id>", "关联资源 ID (
|
|
392
|
+
.requiredOption("--product-type <type>", "类型 (exam_level|iiqe_unit)")
|
|
393
|
+
.requiredOption("--ref-id <id>", "关联资源 ID (等级 ID 或单元 ID)")
|
|
441
394
|
.requiredOption("--title <title>", "商品标题")
|
|
442
395
|
.option("--cover-url <url>", "封面 URL")
|
|
443
396
|
.option("--status <status>", "状态 (active|inactive)")
|
|
@@ -526,32 +479,28 @@ feedback.command("update <number>").description("更新反馈")
|
|
|
526
479
|
.option("--labels <labels>", "标签(逗号分隔)")
|
|
527
480
|
.alias("edit")
|
|
528
481
|
.action(async (num, o) => { await handleFeedbackUpdate(num, o); });
|
|
529
|
-
// ── Knowledge Points (
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
.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>", "按考试筛选")
|
|
533
486
|
.option("--type <type>", "按类型筛选")
|
|
534
487
|
.option("--status <status>", "按状态筛选")
|
|
535
488
|
.option("--keyword <keyword>", "搜索标题")
|
|
536
489
|
.option("--page <page>", "页码", "1")
|
|
537
490
|
.option("--page-size <size>", "每页数量", "20")
|
|
538
491
|
.alias("ls")
|
|
539
|
-
.action(async (o) => { await
|
|
540
|
-
|
|
541
|
-
.requiredOption("--
|
|
492
|
+
.action(async (o) => { await handleCfaKnowledgePointsList(o); });
|
|
493
|
+
cfaKps.command("create").description("创建考点")
|
|
494
|
+
.requiredOption("--exam-id <id>", "考试 ID")
|
|
542
495
|
.requiredOption("--type <type>", "类型 (qa|knowledge|summary_note)")
|
|
543
496
|
.requiredOption("--title <title>", "标题")
|
|
544
497
|
.requiredOption("--content <content>", "内容")
|
|
545
498
|
.option("--body <content>", "内容(--content 的别名)")
|
|
546
|
-
.option("--syllabus-id <id>", "大纲 ID")
|
|
547
|
-
.option("--section-id <id>", "章节 ID")
|
|
548
499
|
.option("--sort-order <n>", "排序")
|
|
549
500
|
.option("--status <status>", "状态 (draft|published|archived)")
|
|
550
501
|
.alias("new")
|
|
551
|
-
.action(async (o) => { await
|
|
552
|
-
|
|
553
|
-
.option("--syllabus-id <id>", "大纲 ID")
|
|
554
|
-
.option("--section-id <id>", "章节 ID")
|
|
502
|
+
.action(async (o) => { await handleCfaKnowledgePointCreate(mergeBody(o)); });
|
|
503
|
+
cfaKps.command("update <id>").description("更新考点")
|
|
555
504
|
.option("--type <type>", "类型 (qa|knowledge|summary_note)")
|
|
556
505
|
.option("--title <title>", "标题")
|
|
557
506
|
.option("--content <content>", "内容")
|
|
@@ -559,10 +508,10 @@ kps.command("update <id>").description("更新知识点")
|
|
|
559
508
|
.option("--sort-order <n>", "排序")
|
|
560
509
|
.option("--status <status>", "状态 (draft|published|archived)")
|
|
561
510
|
.alias("edit")
|
|
562
|
-
.action(async (id, o) => { await
|
|
563
|
-
|
|
511
|
+
.action(async (id, o) => { await handleCfaKnowledgePointUpdate(id, mergeBody(o)); });
|
|
512
|
+
cfaKps.command("delete <id>").description("删除考点")
|
|
564
513
|
.alias("rm")
|
|
565
|
-
.action(async (id) => { await
|
|
514
|
+
.action(async (id) => { await handleCfaKnowledgePointDelete(id); });
|
|
566
515
|
// ── Help Articles (帮助文章) ──────────────────────────────────
|
|
567
516
|
const helpArticles = program.command("help-articles").description("帮助文章管理");
|
|
568
517
|
helpArticles.command("list").description("查看文章列表")
|
|
@@ -656,40 +605,6 @@ activationCodes.command("create-batch").description("批量生成激活码")
|
|
|
656
605
|
.option("--expires-at <date>", "过期时间 (ISO 日期)")
|
|
657
606
|
.alias("new")
|
|
658
607
|
.action(async (o) => { await handleActivationCodeBatchCreate(o); });
|
|
659
|
-
// ── Resource Packs (资源包) ───────────────────────────────────
|
|
660
|
-
const resourcePacks = program.command("resource-packs").description("资源包管理");
|
|
661
|
-
resourcePacks.command("list").description("查看资源包列表")
|
|
662
|
-
.option("--status <status>", "按状态筛选")
|
|
663
|
-
.option("--bank-id <id>", "按题库筛选")
|
|
664
|
-
.option("--keyword <keyword>", "搜索标题")
|
|
665
|
-
.option("--page <page>", "页码", "1")
|
|
666
|
-
.option("--page-size <size>", "每页数量", "20")
|
|
667
|
-
.alias("ls")
|
|
668
|
-
.action(async (o) => { await handleResourcePacksList(o); });
|
|
669
|
-
resourcePacks.command("show <id>").description("查看资源包详情")
|
|
670
|
-
.alias("get")
|
|
671
|
-
.action(async (id) => { await handleResourcePackShow(id); });
|
|
672
|
-
resourcePacks.command("create").description("创建资源包")
|
|
673
|
-
.requiredOption("--title <title>", "标题")
|
|
674
|
-
.option("--bank-id <id>", "题库 ID")
|
|
675
|
-
.option("--cover-url <url>", "封面 URL")
|
|
676
|
-
.option("--description <desc>", "描述")
|
|
677
|
-
.option("--status <status>", "状态")
|
|
678
|
-
.option("--sort-order <n>", "排序")
|
|
679
|
-
.alias("new")
|
|
680
|
-
.action(async (o) => { await handleResourcePackCreate(o); });
|
|
681
|
-
resourcePacks.command("update <id>").description("更新资源包")
|
|
682
|
-
.option("--title <title>", "标题")
|
|
683
|
-
.option("--bank-id <id>", "题库 ID")
|
|
684
|
-
.option("--cover-url <url>", "封面 URL")
|
|
685
|
-
.option("--description <desc>", "描述")
|
|
686
|
-
.option("--status <status>", "状态")
|
|
687
|
-
.option("--sort-order <n>", "排序")
|
|
688
|
-
.alias("edit")
|
|
689
|
-
.action(async (id, o) => { await handleResourcePackUpdate(id, o); });
|
|
690
|
-
resourcePacks.command("delete <id>").description("删除资源包")
|
|
691
|
-
.alias("rm")
|
|
692
|
-
.action(async (id) => { await handleResourcePackDelete(id); });
|
|
693
608
|
// ── Admins (管理员) ───────────────────────────────────────────
|
|
694
609
|
const admins = program.command("admins").description("管理员管理");
|
|
695
610
|
admins.command("list").description("查看管理员列表")
|
|
@@ -713,6 +628,76 @@ admins.command("disable <id>").description("禁用管理员")
|
|
|
713
628
|
.action(async (id) => { await handleAdminDisable(id); });
|
|
714
629
|
admins.command("enable <id>").description("启用管理员")
|
|
715
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); });
|
|
716
701
|
// ── Stats (统计) ──────────────────────────────────────────────
|
|
717
702
|
program.command("stats").description("查看统计数据")
|
|
718
703
|
.action(async () => { await handleStats(); });
|
|
@@ -752,7 +737,7 @@ dashboard.command("learning").description("学习数据")
|
|
|
752
737
|
.action(async (o) => { await handleDashboardLearning(o); });
|
|
753
738
|
dashboard.command("products").description("商品数据")
|
|
754
739
|
.option("--range <range>", "时间范围 (7d|30d)", "7d")
|
|
755
|
-
.option("--product-type <type>", "商品类型 (
|
|
740
|
+
.option("--product-type <type>", "商品类型 (exam_level|iiqe_unit)")
|
|
756
741
|
.action(async (o) => { await handleDashboardProducts(o); });
|
|
757
742
|
// ── OpenCode Server (集成配置) ──────────────────────────────────
|
|
758
743
|
const opencodeServer = program.command("opencode-server").description("OpenCode Server 集成配置");
|
|
@@ -816,7 +801,7 @@ promptTemplates.command("show <id>").description("查看模板详情")
|
|
|
816
801
|
.action(async (id) => { await handlePromptTemplateShow(id); });
|
|
817
802
|
promptTemplates.command("create <groupId>").description("创建模板")
|
|
818
803
|
.requiredOption("--name <name>", "名称")
|
|
819
|
-
.option("--scope <scope>", "范围 (global|
|
|
804
|
+
.option("--scope <scope>", "范围 (global|module)", "global")
|
|
820
805
|
.option("--scope-id <id>", "范围 ID")
|
|
821
806
|
.option("--field-type <type>", "字段类型")
|
|
822
807
|
.option("--system-prompt <prompt>", "提示词内容")
|