foco-cli 0.10.0 → 0.11.1

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.
Files changed (74) hide show
  1. package/README.md +200 -130
  2. package/dist/commands/cfa-knowledge-points.d.ts +25 -0
  3. package/dist/commands/cfa-knowledge-points.d.ts.map +1 -0
  4. package/dist/commands/{knowledge-points.js → cfa-knowledge-points.js} +11 -19
  5. package/dist/commands/cfa-knowledge-points.js.map +1 -0
  6. package/dist/commands/cfa-levels.d.ts +20 -0
  7. package/dist/commands/cfa-levels.d.ts.map +1 -0
  8. package/dist/commands/{exam-subjects.js → cfa-levels.js} +11 -11
  9. package/dist/commands/cfa-levels.js.map +1 -0
  10. package/dist/commands/cfa-modules.d.ts +20 -0
  11. package/dist/commands/cfa-modules.d.ts.map +1 -0
  12. package/dist/commands/{exam-levels.js → cfa-modules.js} +11 -11
  13. package/dist/commands/cfa-modules.js.map +1 -0
  14. package/dist/commands/cfa-subjects.d.ts +20 -0
  15. package/dist/commands/{exam-modules.d.ts.map → cfa-subjects.d.ts.map} +1 -1
  16. package/dist/commands/{exam-modules.js → cfa-subjects.js} +11 -11
  17. package/dist/commands/{exam-modules.js.map → cfa-subjects.js.map} +1 -1
  18. package/dist/commands/iiqe-sections.d.ts +13 -0
  19. package/dist/commands/iiqe-sections.d.ts.map +1 -0
  20. package/dist/commands/iiqe-sections.js +46 -0
  21. package/dist/commands/iiqe-sections.js.map +1 -0
  22. package/dist/commands/iiqe-syllabi.d.ts +14 -0
  23. package/dist/commands/iiqe-syllabi.d.ts.map +1 -0
  24. package/dist/commands/iiqe-syllabi.js +33 -0
  25. package/dist/commands/iiqe-syllabi.js.map +1 -0
  26. package/dist/commands/iiqe-units.d.ts +21 -0
  27. package/dist/commands/iiqe-units.d.ts.map +1 -0
  28. package/dist/commands/iiqe-units.js +49 -0
  29. package/dist/commands/iiqe-units.js.map +1 -0
  30. package/dist/commands/issues.js +3 -3
  31. package/dist/commands/issues.js.map +1 -1
  32. package/dist/commands/questions.d.ts +1 -1
  33. package/dist/commands/questions.d.ts.map +1 -1
  34. package/dist/commands/questions.js +1 -1
  35. package/dist/commands/questions.js.map +1 -1
  36. package/dist/index.js +137 -185
  37. package/dist/index.js.map +1 -1
  38. package/dist/types.d.ts +72 -18
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/dist/app/admin/questions/[questionId]/edit/page.d.ts +0 -1
  42. package/dist/app/admin/questions/[questionId]/edit/page.d.ts.map +0 -1
  43. package/dist/app/admin/questions/[questionId]/edit/page.js +0 -2
  44. package/dist/app/admin/questions/[questionId]/edit/page.js.map +0 -1
  45. package/dist/commands/banks.d.ts +0 -9
  46. package/dist/commands/banks.d.ts.map +0 -1
  47. package/dist/commands/banks.js +0 -18
  48. package/dist/commands/banks.js.map +0 -1
  49. package/dist/commands/cc-connect.d.ts +0 -8
  50. package/dist/commands/cc-connect.d.ts.map +0 -1
  51. package/dist/commands/cc-connect.js +0 -27
  52. package/dist/commands/cc-connect.js.map +0 -1
  53. package/dist/commands/exam-levels.d.ts +0 -20
  54. package/dist/commands/exam-levels.d.ts.map +0 -1
  55. package/dist/commands/exam-levels.js.map +0 -1
  56. package/dist/commands/exam-modules.d.ts +0 -20
  57. package/dist/commands/exam-subjects.d.ts +0 -20
  58. package/dist/commands/exam-subjects.d.ts.map +0 -1
  59. package/dist/commands/exam-subjects.js.map +0 -1
  60. package/dist/commands/exams.d.ts +0 -25
  61. package/dist/commands/exams.d.ts.map +0 -1
  62. package/dist/commands/exams.js +0 -82
  63. package/dist/commands/exams.js.map +0 -1
  64. package/dist/commands/knowledge-points.d.ts +0 -29
  65. package/dist/commands/knowledge-points.d.ts.map +0 -1
  66. package/dist/commands/knowledge-points.js.map +0 -1
  67. package/dist/commands/resource-packs.d.ts +0 -26
  68. package/dist/commands/resource-packs.d.ts.map +0 -1
  69. package/dist/commands/resource-packs.js +0 -64
  70. package/dist/commands/resource-packs.js.map +0 -1
  71. package/dist/commands/syllabi.d.ts +0 -26
  72. package/dist/commands/syllabi.d.ts.map +0 -1
  73. package/dist/commands/syllabi.js +0 -65
  74. package/dist/commands/syllabi.js.map +0 -1
package/README.md CHANGED
@@ -11,130 +11,210 @@ npm install -g foco-cli
11
11
  ## 登录
12
12
 
13
13
  ```bash
14
- # 本地开发服务器登录
15
- foco login --dev
16
-
17
- # 指定服务器地址
18
- foco login https://your-foco-server.com
19
-
20
- # 查看登录状态
21
- foco auth status
22
-
23
- # 登出
24
- foco auth logout
14
+ foco login --dev # 本地开发服务器 (localhost:3001)
15
+ foco login https://your.com # 指定服务器
16
+ foco auth status # 查看状态
17
+ foco auth logout # 登出
25
18
  ```
26
19
 
27
- 登录成功后凭证存储在 `~/.foco/config.json`。
20
+ 凭证存储在 `~/.foco/config.json`。
28
21
 
29
22
  ## 命令参考
30
23
 
31
- ### 认证管理
24
+ ### 认证
32
25
 
33
26
  | 命令 | 说明 |
34
27
  |------|------|
35
- | `foco login [--dev]` | 登录(`--dev` 使用 localhost:3001) |
36
- | `foco auth status` | 查看登录状态 |
28
+ | `foco login [--dev] [-u <user> -p <pass>]` | 登录 |
29
+ | `foco auth status` | 查看状态 |
37
30
  | `foco auth logout` | 登出 |
38
31
 
39
- ### 题库管理 (banks)
32
+ ### 考试 (exams)
40
33
 
41
34
  | 命令 | 说明 |
42
35
  |------|------|
43
- | `foco banks list [--status <status>] [--exam-id <id>] [--keyword <kw>]` | 查看题库列表 |
44
- | `foco banks show <id>` | 查看题库详情 |
36
+ | `foco exams list` | 列表 |
37
+ | `foco exams show <id>` | 详情 |
38
+ | `foco exams create --code <code> --name <name>` | 创建 |
39
+ | `foco exams update <id>` | 更新 |
40
+ | `foco exams delete <id> [--cascade] [-f]` | 删除(`--cascade` 级联删除关联数据) |
45
41
 
46
- status 可选值:`draft` | `published` | `archived`
42
+ ### CFA 等级 (cfa-levels)
47
43
 
48
- ### 题目管理 (questions)
44
+ CFA 考试的层级结构:Level I / Level II / Level III。
49
45
 
50
46
  | 命令 | 说明 |
51
47
  |------|------|
52
- | `foco questions list [--bank-id <id>] [--type <type>] [--difficulty <1-5>]` | 查看题目列表 |
53
- | `foco questions show <id>` | 查看题目详情 |
48
+ | `foco cfa-levels list --exam-id <id>` | 列表 |
49
+ | `foco cfa-levels show <id>` | 详情 |
50
+ | `foco cfa-levels create --exam-id <id> --code <code> --name <name>` | 创建 |
51
+ | `foco cfa-levels update <id>` | 更新 |
52
+ | `foco cfa-levels delete <id>` | 删除 |
54
53
 
55
- type 可选值:`single_choice` | `multiple_choice` | `true_false` | `fill_blank` | `short_answer`
54
+ ### CFA 科目 (cfa-subjects)
56
55
 
57
- ### 考试管理 (exams)
56
+ 每个等级下的科目(如 Ethical Standards、Quantitative Methods 等)。
58
57
 
59
58
  | 命令 | 说明 |
60
59
  |------|------|
61
- | `foco exams list` | 查看考试列表 |
62
- | `foco exams show <id>` | 查看考试详情 |
63
- | `foco exams create --code <code> --name <name>` | 创建考试 |
64
- | `foco exams update <id> [--name <name>] [--is-visible <bool>]` | 更新考试 |
65
- | `foco exams delete <id>` | 删除考试 |
60
+ | `foco cfa-subjects list --level-id <id>` | 列表 |
61
+ | `foco cfa-subjects show <id>` | 详情 |
62
+ | `foco cfa-subjects create --level-id <id> --code <code> --name <name>` | 创建 |
63
+ | `foco cfa-subjects update <id>` | 更新 |
64
+ | `foco cfa-subjects delete <id>` | 删除 |
65
+
66
+ ### CFA 学习模块 (cfa-modules)
66
67
 
67
- ### 大纲管理 (syllabi)
68
+ 科目下的学习模块。
68
69
 
69
70
  | 命令 | 说明 |
70
71
  |------|------|
71
- | `foco syllabi list [--exam-id <id>]` | 查看大纲列表 |
72
- | `foco syllabi show <id>` | 查看大纲详情 |
73
- | `foco syllabi create --exam-id <id> --name <name>` | 创建大纲 |
74
- | `foco syllabi update <id> [--name <name>]` | 更新大纲 |
75
- | `foco syllabi delete <id>` | 删除大纲 |
72
+ | `foco cfa-modules list --subject-id <id>` | 列表 |
73
+ | `foco cfa-modules show <id>` | 详情 |
74
+ | `foco cfa-modules create --subject-id <id> --code <code> --name <name>` | 创建 |
75
+ | `foco cfa-modules update <id>` | 更新 |
76
+ | `foco cfa-modules delete <id>` | 删除 |
76
77
 
77
- ### 知识点管理 (knowledge-points)
78
+ ### CFA 考点 (cfa-knowledge-points)
79
+
80
+ 模块下的考点,支持 qa / knowledge / summary_note 三种类型。
78
81
 
79
82
  | 命令 | 说明 |
80
83
  |------|------|
81
- | `foco knowledge-points list [--bank-id <id>] [--type <type>]` | 查看知识点列表 |
82
- | `foco knowledge-points create --bank-id <id> --type <type> --title <t> --content <c>` | 创建知识点 |
83
- | `foco knowledge-points update <id> [--title <t>] [--content <c>]` | 更新知识点 |
84
- | `foco knowledge-points delete <id>` | 删除知识点 |
84
+ | `foco cfa-knowledge-points list [--exam-id <id>] [--type <type>]` | 列表 |
85
+ | `foco cfa-knowledge-points create --exam-id <id> --type <type> --title <t> --content <c>` | 创建 |
86
+ | `foco cfa-knowledge-points update <id>` | 更新 |
87
+ | `foco cfa-knowledge-points delete <id>` | 删除 |
85
88
 
86
89
  type 可选值:`qa` | `knowledge` | `summary_note`
87
90
 
88
- ### 工单管理 (issues)
91
+ ### IIQE (iiqe-units)
92
+
93
+ IIQE 考试的卷别(卷一保险、卷三汽车等)。
89
94
 
90
95
  | 命令 | 说明 |
91
96
  |------|------|
92
- | `foco issues list [--status <s>] [--priority <p>] [--assignee-id <id>] [--search <kw>]` | 查看工单列表 |
93
- | `foco issues show <id>` | 查看工单详情 |
94
- | `foco issues create --title <title> [options]` | 创建工单 |
95
- | `foco issues update <id> [options]` | 更新工单 |
96
- | `foco issues comment <id> -m <text>` | 添加评论 |
97
+ | `foco iiqe-units list --exam-id <id>` | 列表 |
98
+ | `foco iiqe-units show <id>` | 详情 |
99
+ | `foco iiqe-units create --exam-id <id> --code <code> --name <name>` | 创建 |
100
+ | `foco iiqe-units update <id> [--required-product-id <id>]` | 更新(可绑定付费产品) |
101
+ | `foco iiqe-units delete <id>` | 删除 |
97
102
 
98
- **status 可选值**:`backlog` | `todo` | `in_progress` | `done` | `cancelled`
103
+ ### IIQE 大纲 (iiqe-syllabi)
99
104
 
100
- **priority 可选值**:`urgent` | `high` | `medium` | `low` | `none`
105
+ 每卷下的大纲版本,有版本标签和激活状态。
101
106
 
102
- **创建工单示例**:
103
- ```bash
104
- # 基本创建
105
- foco issues create --title "修复登录页 bug"
107
+ | 命令 | 说明 |
108
+ |------|------|
109
+ | `foco iiqe-syllabi list --unit-id <id>` | 列表 |
110
+ | `foco iiqe-syllabi show <id>` | 详情 |
111
+ | `foco iiqe-syllabi update <id>` | 更新 |
112
+ | `foco iiqe-syllabi delete <id>` | 删除 |
113
+
114
+ ### IIQE 章节 (iiqe-sections)
115
+
116
+ 大纲下的树形章节结构,支持多级嵌套(parentId)。
117
+
118
+ | 命令 | 说明 |
119
+ |------|------|
120
+ | `foco iiqe-sections list --syllabus-id <id>` | 列表 |
121
+ | `foco iiqe-sections show <id>` | 详情 |
122
+ | `foco iiqe-sections update <id> [--parent-id <id>]` | 更新 |
123
+ | `foco iiqe-sections delete <id>` | 删除 |
124
+
125
+ ### 题目 (questions)
126
+
127
+ | 命令 | 说明 |
128
+ |------|------|
129
+ | `foco questions list [--exam-id <id>] [--type <type>] [--keyword <kw>]` | 列表 |
130
+ | `foco questions show <id>` | 详情 |
131
+ | `foco questions format --id <id> [--fields <f>] [--apply]` | AI 格式化题目 |
132
+ | `foco questions update-title --id <id> --title <t>` | 更新标题 |
133
+ | `foco questions update-title --file <path>` | 批量更新标题 |
134
+
135
+ type 可选值:`single` | `multiple` | `true_false`
136
+
137
+ ### 商品 (products)
138
+
139
+ | 命令 | 说明 |
140
+ |------|------|
141
+ | `foco products list [--product-type <type>]` | 列表 |
142
+ | `foco products show <id>` | 详情 |
143
+ | `foco products create --product-type <type> --ref-id <id> --title <t>` | 创建 |
144
+ | `foco products update <id>` | 更新 |
145
+ | `foco products delete <id>` | 删除 |
146
+
147
+ product-type 可选值:`exam_level` | `iiqe_unit`
148
+
149
+ ### 激活码 (activation-codes)
150
+
151
+ | 命令 | 说明 |
152
+ |------|------|
153
+ | `foco activation-codes list [--batch-no <no>] [--status <s>]` | 列表 |
154
+ | `foco activation-codes create-batch --sku-id <id> --count <n> [--batch-no <no>]` | 批量生成 |
155
+
156
+ ### 工单 (issues)
157
+
158
+ | 命令 | 说明 |
159
+ |------|------|
160
+ | `foco issues list [--status <s>] [--priority <p>] [--assignee-id <id>] [--search <kw>]` | 列表 |
161
+ | `foco issues show <id>` | 详情 |
162
+ | `foco issues create --title <title> [options]` | 创建 |
163
+ | `foco issues update <id> [options]` | 更新 |
164
+ | `foco issues comment <id> -m <text>` | 添加评论 |
165
+ | `foco issues comments <id>` | 查看评论列表 |
166
+ | `foco issues edit-comment <id> --comment-id <cid> -m <text>` | 编辑评论 |
167
+ | `foco issues delete-comment <id> --comment-id <cid>` | 删除评论 |
168
+
169
+ status:`backlog` | `todo` | `in_progress` | `done` | `cancelled`
170
+ priority:`urgent` | `high` | `medium` | `low` | `none`
106
171
 
107
- # 完整参数
172
+ ```bash
108
173
  foco issues create \
109
174
  --title "知识点模块开关" \
110
- --description "按题库配置显示哪些模块" \
175
+ --description "按考试配置显示哪些模块" \
111
176
  --priority high \
112
177
  --labels "frontend,backend" \
113
178
  --assignee-id 2 \
114
179
  --due-date 2026-06-01
115
180
  ```
116
181
 
117
- **查找指派人 ID**:`foco admins list`
182
+ ### Epic 目标 (epics)
183
+
184
+ | 命令 | 说明 |
185
+ |------|------|
186
+ | `foco epics list` | 列表 |
187
+ | `foco epics show <id>` | 详情 |
188
+ | `foco epics create --title <t>` | 创建 |
189
+ | `foco epics update <id>` | 更新 |
190
+
191
+ ### 项目 (projects)
192
+
193
+ | 命令 | 说明 |
194
+ |------|------|
195
+ | `foco projects list` | 列表 |
196
+ | `foco projects show <id>` | 详情 |
197
+ | `foco projects create --name <n> --slug <s>` | 创建 |
198
+ | `foco projects update <id>` | 更新 |
199
+ | `foco projects delete <id>` | 删除 |
118
200
 
119
- ### 项目管理 (projects)
201
+ ### 开发日志 (changelogs)
120
202
 
121
203
  | 命令 | 说明 |
122
204
  |------|------|
123
- | `foco projects list` | 查看项目列表 |
124
- | `foco projects show <id>` | 查看项目详情 |
125
- | `foco projects create --name <name> --slug <slug>` | 创建项目 |
126
- | `foco projects update <id> [--name <name>]` | 更新项目 |
127
- | `foco projects delete <id>` | 删除项目 |
205
+ | `foco changelogs list` | 列表 |
206
+ | `foco changelogs create --date <YYYY-MM-DD> --content <md>` | 创建 |
207
+ | `foco changelogs update <id> --content <md>` | 更新 |
128
208
 
129
209
  ### 每日站会 (huddles)
130
210
 
131
211
  | 命令 | 说明 |
132
212
  |------|------|
133
- | `foco huddles list [--date <YYYY-MM-DD>] [--author-id <id>]` | 查看日报列表 |
134
- | `foco huddles show <id>` | 查看日报详情 |
135
- | `foco huddles create --date <YYYY-MM-DD> --content '<json>'` | 创建日报 |
136
- | `foco huddles update <id> --content '<json>'` | 更新日报 |
137
- | `foco huddles delete <id>` | 删除日报 |
213
+ | `foco huddles list [--date <YYYY-MM-DD>]` | 列表 |
214
+ | `foco huddles show <id>` | 详情 |
215
+ | `foco huddles create --date <YYYY-MM-DD> --content '<json>'` | 创建 |
216
+ | `foco huddles update <id> --content '<json>'` | 更新 |
217
+ | `foco huddles delete <id>` | 删除 |
138
218
 
139
219
  content 格式:`[{"sectionName":"今日工作","content":"..."}]`
140
220
 
@@ -142,115 +222,107 @@ content 格式:`[{"sectionName":"今日工作","content":"..."}]`
142
222
 
143
223
  | 命令 | 说明 |
144
224
  |------|------|
145
- | `foco knowledge-base list [--category <cat>]` | 查看文档列表 |
146
- | `foco knowledge-base show <id>` | 查看文档详情 |
147
- | `foco knowledge-base create --title <t> --slug <s> [--content <c>]` | 创建文档 |
148
- | `foco knowledge-base update <id> [--content <c>]` | 更新文档 |
149
- | `foco knowledge-base delete <id>` | 删除文档 |
225
+ | `foco knowledge-base list [--category <cat>]` | 列表 |
226
+ | `foco knowledge-base show <id>` | 详情 |
227
+ | `foco knowledge-base create --title <t> --slug <s>` | 创建 |
228
+ | `foco knowledge-base update <id>` | 更新 |
229
+ | `foco knowledge-base delete <id>` | 删除 |
150
230
 
151
- category 可选值:`culture` | `product` | `tech` | `ops` | `management` | `general`
231
+ category:`culture` | `product` | `tech` | `cli-docs` | `ops` | `management` | `general`
152
232
 
153
233
  ### 帮助文章 (help-articles)
154
234
 
155
235
  | 命令 | 说明 |
156
236
  |------|------|
157
- | `foco help-articles list` | 查看文章列表 |
158
- | `foco help-articles show <id>` | 查看文章详情 |
159
- | `foco help-articles create --title <t> --slug <s>` | 创建文章 |
160
- | `foco help-articles update <id>` | 更新文章 |
161
- | `foco help-articles delete <id>` | 删除文章 |
237
+ | `foco help-articles list` | 列表 |
238
+ | `foco help-articles show <id>` | 详情 |
239
+ | `foco help-articles create --title <t> --slug <s>` | 创建 |
240
+ | `foco help-articles update <id>` | 更新 |
241
+ | `foco help-articles delete <id>` | 删除 |
162
242
 
163
- ### 讨论管理 (threads)
243
+ ### 讨论 (threads)
164
244
 
165
245
  | 命令 | 说明 |
166
246
  |------|------|
167
- | `foco threads list [--status <s>]` | 查看讨论列表 |
168
- | `foco threads show <id>` | 查看讨论详情 |
169
- | `foco threads update <id> --status <s>` | 更新讨论状态 |
170
- | `foco threads reply <id> -m <text>` | 回复讨论 |
247
+ | `foco threads list` | 列表 |
248
+ | `foco threads show <id>` | 详情 |
249
+ | `foco threads update <id> --status <s>` | 更新状态 |
250
+ | `foco threads reply <id> -m <text>` | 回复 |
171
251
 
172
- status 可选值:`open` | `resolved` | `closed`
252
+ status:`open` | `resolved` | `closed`
173
253
 
174
- ### 反馈管理 (feedback)
254
+ ### 反馈 (feedback)
175
255
 
176
256
  | 命令 | 说明 |
177
257
  |------|------|
178
- | `foco feedback list [--state <s>] [--labels <l>]` | 查看反馈列表 |
179
- | `foco feedback show <number>` | 查看反馈详情 |
180
- | `foco feedback create --title <t>` | 创建反馈 |
181
- | `foco feedback update <number> [--state <s>]` | 更新反馈 |
182
-
183
- ### 商品管理 (products)
184
-
185
- | 命令 | 说明 |
186
- |------|------|
187
- | `foco products list [--product-type <type>]` | 查看商品列表 |
188
- | `foco products show <id>` | 查看商品详情 |
189
- | `foco products create --product-type <type> --ref-id <id> --title <t>` | 创建商品 |
190
- | `foco products update <id>` | 更新商品 |
191
- | `foco products delete <id>` | 删除商品 |
192
-
193
- product-type 可选值:`bank` | `material`
258
+ | `foco feedback list [--state <s>] [--labels <l>]` | 列表 |
259
+ | `foco feedback show <number>` | 详情 |
260
+ | `foco feedback create --title <t>` | 创建 |
261
+ | `foco feedback update <number>` | 更新 |
194
262
 
195
- ### 资源包管理 (resource-packs)
263
+ ### 管理员 (admins)
196
264
 
197
265
  | 命令 | 说明 |
198
266
  |------|------|
199
- | `foco resource-packs list [--bank-id <id>]` | 查看资源包列表 |
200
- | `foco resource-packs show <id>` | 查看资源包详情 |
201
- | `foco resource-packs create --title <t>` | 创建资源包 |
202
- | `foco resource-packs update <id>` | 更新资源包 |
203
- | `foco resource-packs delete <id>` | 删除资源包 |
267
+ | `foco admins list` | 列表 |
268
+ | `foco admins show <id>` | 详情 |
269
+ | `foco admins create --username <u> --password <p>` | 创建 |
270
+ | `foco admins update <id>` | 更新 |
271
+ | `foco admins disable <id>` | 禁用 |
272
+ | `foco admins enable <id>` | 启用 |
204
273
 
205
- ### 激活码管理 (activation-codes)
274
+ ### 用户 (users)
206
275
 
207
276
  | 命令 | 说明 |
208
277
  |------|------|
209
- | `foco activation-codes list [--batch-no <no>]` | 查看激活码列表 |
210
- | `foco activation-codes create-batch --sku-id <id> --count <n>` | 批量生成激活码 |
278
+ | `foco users list [--keyword <kw>]` | 列表 |
211
279
 
212
- ### 管理员管理 (admins)
280
+ ### 订单 (orders)
213
281
 
214
282
  | 命令 | 说明 |
215
283
  |------|------|
216
- | `foco admins list` | 查看管理员列表(用于查找指派人 ID) |
217
- | `foco admins show <id>` | 查看管理员详情 |
218
- | `foco admins create --username <u> --password <p>` | 创建管理员 |
219
- | `foco admins update <id> [--display-name <n>]` | 更新管理员 |
284
+ | `foco orders list [--status <s>]` | 列表 |
220
285
 
221
- ### 开发日志 (changelogs)
286
+ ### 仪表盘 (dashboard)
222
287
 
223
288
  | 命令 | 说明 |
224
289
  |------|------|
225
- | `foco changelogs list` | 查看日志列表 |
226
- | `foco changelogs create --date <YYYY-MM-DD> --content <md>` | 创建日志 |
227
- | `foco changelogs update <id> --content <md>` | 更新日志 |
290
+ | `foco dashboard overview [--range <7d\|30d>]` | 总览 |
291
+ | `foco dashboard learning [--range <7d\|30d>]` | 学习数据 |
292
+ | `foco dashboard products [--range <7d\|30d>]` | 商品数据 |
228
293
 
229
- ### 用户管理 (users)
294
+ ### 统计 (stats)
230
295
 
231
296
  | 命令 | 说明 |
232
297
  |------|------|
233
- | `foco users list [--keyword <kw>]` | 查看用户列表 |
298
+ | `foco stats` | 查看统计数据 |
234
299
 
235
- ### 订单管理 (orders)
300
+ ### 集成配置
236
301
 
237
302
  | 命令 | 说明 |
238
303
  |------|------|
239
- | `foco orders list [--status <s>]` | 查看订单列表 |
304
+ | `foco opencode-server get` | 查看 OpenCode Server 配置 |
305
+ | `foco opencode-server set [--url <url>] [--password <pw>]` | 更新配置 |
306
+ | `foco ai-config get` | 查看 AI 模型配置 |
307
+ | `foco ai-config set [--api-key <key>] [--model <model>]` | 更新配置 |
240
308
 
241
- ### 仪表盘 (dashboard)
309
+ ### AI 提示词 (prompt-groups / prompt-templates)
242
310
 
243
311
  | 命令 | 说明 |
244
312
  |------|------|
245
- | `foco dashboard overview [--range <7d|30d>]` | 总览数据 |
246
- | `foco dashboard learning [--range <7d|30d>]` | 学习数据 |
247
- | `foco dashboard products [--range <7d|30d>]` | 商品数据 |
313
+ | `foco prompt-groups list` | 分组列表 |
314
+ | `foco prompt-groups show <id>` | 分组详情 |
315
+ | `foco prompt-groups create --name <n> --slug <s>` | 创建分组 |
316
+ | `foco prompt-templates list <groupId>` | 模板列表 |
317
+ | `foco prompt-templates create <groupId> --name <n>` | 创建模板 |
318
+ | `foco prompt-templates update <id>` | 更新模板 |
248
319
 
249
- ### 统计 (stats)
320
+ ### 自更新
250
321
 
251
322
  | 命令 | 说明 |
252
323
  |------|------|
253
- | `foco stats` | 查看统计数据 |
324
+ | `foco update` | 检查新版本 |
325
+ | `foco upgrade` | 升级到最新版 |
254
326
 
255
327
  ## 输出格式
256
328
 
@@ -274,8 +346,6 @@ npm run build # TypeScript 编译
274
346
 
275
347
  ```bash
276
348
  cd cli
277
- # 修改 package.json 中的 version
278
349
  npm run dist # build + pack
279
350
  npm publish --access public --registry https://registry.npmjs.org/
280
- npm install -g /path/to/cli
281
351
  ```
@@ -0,0 +1,25 @@
1
+ export declare function handleCfaKnowledgePointsList(options: {
2
+ examCode?: string;
3
+ type?: string;
4
+ status?: string;
5
+ keyword?: string;
6
+ page?: string;
7
+ pageSize?: string;
8
+ }): Promise<void>;
9
+ export declare function handleCfaKnowledgePointCreate(options: {
10
+ examCode: string;
11
+ type: string;
12
+ title: string;
13
+ content: string;
14
+ sortOrder?: string;
15
+ status?: string;
16
+ }): Promise<void>;
17
+ export declare function handleCfaKnowledgePointUpdate(id: string, options: {
18
+ type?: string;
19
+ title?: string;
20
+ content?: string;
21
+ sortOrder?: string;
22
+ status?: string;
23
+ }): Promise<void>;
24
+ export declare function handleCfaKnowledgePointDelete(id: string): Promise<void>;
25
+ //# sourceMappingURL=cfa-knowledge-points.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfa-knowledge-points.d.ts","sourceRoot":"","sources":["../../src/commands/cfa-knowledge-points.ts"],"names":[],"mappings":"AAGA,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB;AAED,wBAAsB,6BAA6B,CAAC,OAAO,EAAE;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhB;AAED,wBAAsB,6BAA6B,CACjD,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACA,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS7E"}
@@ -1,8 +1,8 @@
1
1
  import { apiCall, outputJSON } from "../lib/api.js";
2
- export async function handleKnowledgePointsList(options) {
3
- const { data } = await apiCall("/api/admin/v1/knowledge-points", {
2
+ export async function handleCfaKnowledgePointsList(options) {
3
+ const { data } = await apiCall("/api/admin/v1/cfa/knowledge-points", {
4
4
  params: {
5
- bankId: options.bankId,
5
+ examCode: options.examCode,
6
6
  type: options.type,
7
7
  status: options.status,
8
8
  keyword: options.keyword,
@@ -12,33 +12,25 @@ export async function handleKnowledgePointsList(options) {
12
12
  });
13
13
  outputJSON({ status: "ok", data });
14
14
  }
15
- export async function handleKnowledgePointCreate(options) {
15
+ export async function handleCfaKnowledgePointCreate(options) {
16
16
  const body = {
17
- bankId: options.bankId,
17
+ examCode: options.examCode,
18
18
  type: options.type,
19
19
  title: options.title,
20
20
  content: options.content,
21
21
  };
22
- if (options.syllabusId)
23
- body.syllabusId = options.syllabusId;
24
- if (options.sectionId)
25
- body.sectionId = options.sectionId;
26
22
  if (options.sortOrder)
27
23
  body.sortOrder = Number(options.sortOrder);
28
24
  if (options.status)
29
25
  body.status = options.status;
30
- const { data } = await apiCall("/api/admin/v1/knowledge-points", {
26
+ const { data } = await apiCall("/api/admin/v1/cfa/knowledge-points", {
31
27
  method: "POST",
32
28
  body,
33
29
  });
34
30
  outputJSON({ status: "ok", data });
35
31
  }
36
- export async function handleKnowledgePointUpdate(id, options) {
32
+ export async function handleCfaKnowledgePointUpdate(id, options) {
37
33
  const body = {};
38
- if (options.syllabusId !== undefined)
39
- body.syllabusId = options.syllabusId || null;
40
- if (options.sectionId !== undefined)
41
- body.sectionId = options.sectionId || null;
42
34
  if (options.type)
43
35
  body.type = options.type;
44
36
  if (options.title)
@@ -49,16 +41,16 @@ export async function handleKnowledgePointUpdate(id, options) {
49
41
  body.sortOrder = Number(options.sortOrder);
50
42
  if (options.status)
51
43
  body.status = options.status;
52
- const { data } = await apiCall(`/api/admin/v1/knowledge-points/${id}`, {
44
+ const { data } = await apiCall(`/api/admin/v1/cfa/knowledge-points/${id}`, {
53
45
  method: "PATCH",
54
46
  body,
55
47
  });
56
48
  outputJSON({ status: "ok", data });
57
49
  }
58
- export async function handleKnowledgePointDelete(id) {
59
- const { data } = await apiCall(`/api/admin/v1/knowledge-points/${id}`, {
50
+ export async function handleCfaKnowledgePointDelete(id) {
51
+ const { data } = await apiCall(`/api/admin/v1/cfa/knowledge-points/${id}`, {
60
52
  method: "DELETE",
61
53
  });
62
54
  outputJSON({ status: "ok", data });
63
55
  }
64
- //# sourceMappingURL=knowledge-points.js.map
56
+ //# sourceMappingURL=cfa-knowledge-points.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfa-knowledge-points.js","sourceRoot":"","sources":["../../src/commands/cfa-knowledge-points.ts"],"names":[],"mappings":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AA4B,EAAE,CAAC;IAEzC,IAAI,OAAO,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3C,IAAI,OAAO,CAAC,KAAK;QAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC9C,IAAI,OAAO,CAAC,OAAO;QAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpD,IAAI,OAAO,CAAC,SAAS;QAAE,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAClE,IAAI,OAAO,CAAC,MAAM;QAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAEjD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAC5B,sCAAsC,EAAE,EAAE,EAC1C;QACE,MAAM,EAAE,OAAO;QACf,IAAI;KACL,CACF,CAAC;IAEF,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,EAAU;IAC5D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAC5B,sCAAsC,EAAE,EAAE,EAC1C;QACE,MAAM,EAAE,QAAQ;KACjB,CACF,CAAC;IAEF,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare function handleCfaLevelsList(options: {
2
+ examCode: string;
3
+ }): Promise<void>;
4
+ export declare function handleCfaLevelShow(id: string): Promise<void>;
5
+ export declare function handleCfaLevelCreate(options: {
6
+ examCode: string;
7
+ code: string;
8
+ name: string;
9
+ description?: string;
10
+ sortOrder?: string;
11
+ isVisible?: string;
12
+ }): Promise<void>;
13
+ export declare function handleCfaLevelUpdate(id: string, options: {
14
+ name?: string;
15
+ description?: string;
16
+ sortOrder?: string;
17
+ isVisible?: string;
18
+ }): Promise<void>;
19
+ export declare function handleCfaLevelDelete(id: string): Promise<void>;
20
+ //# sourceMappingURL=cfa-levels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cfa-levels.d.ts","sourceRoot":"","sources":["../../src/commands/cfa-levels.ts"],"names":[],"mappings":"AAGA,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IACjD,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhB;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlE;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBhB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE;IACP,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMpE"}
@@ -1,13 +1,13 @@
1
1
  import { apiCall, outputJSON } from "../lib/api.js";
2
- export async function handleExamSubjectsList(options) {
3
- const { data } = await apiCall(`/api/admin/v1/exam-levels/${options.levelId}/subjects`);
2
+ export async function handleCfaLevelsList(options) {
3
+ const { data } = await apiCall(`/api/admin/v1/cfa/${options.examCode}/levels`);
4
4
  outputJSON({ status: "ok", data });
5
5
  }
6
- export async function handleExamSubjectShow(id) {
7
- const { data } = await apiCall(`/api/admin/v1/exam-subjects/${id}`);
6
+ export async function handleCfaLevelShow(id) {
7
+ const { data } = await apiCall(`/api/admin/v1/cfa/levels/${id}`);
8
8
  outputJSON({ status: "ok", data });
9
9
  }
10
- export async function handleExamSubjectCreate(options) {
10
+ export async function handleCfaLevelCreate(options) {
11
11
  const body = {
12
12
  code: options.code,
13
13
  name: options.name,
@@ -18,13 +18,13 @@ export async function handleExamSubjectCreate(options) {
18
18
  body.sortOrder = Number(options.sortOrder);
19
19
  if (options.isVisible !== undefined)
20
20
  body.isVisible = options.isVisible === "true";
21
- const { data } = await apiCall(`/api/admin/v1/exam-levels/${options.levelId}/subjects`, {
21
+ const { data } = await apiCall(`/api/admin/v1/cfa/${options.examCode}/levels`, {
22
22
  method: "POST",
23
23
  body,
24
24
  });
25
25
  outputJSON({ status: "ok", data });
26
26
  }
27
- export async function handleExamSubjectUpdate(id, options) {
27
+ export async function handleCfaLevelUpdate(id, options) {
28
28
  const body = {};
29
29
  if (options.name)
30
30
  body.name = options.name;
@@ -34,16 +34,16 @@ export async function handleExamSubjectUpdate(id, options) {
34
34
  body.sortOrder = Number(options.sortOrder);
35
35
  if (options.isVisible !== undefined)
36
36
  body.isVisible = options.isVisible === "true";
37
- const { data } = await apiCall(`/api/admin/v1/exam-subjects/${id}`, {
37
+ const { data } = await apiCall(`/api/admin/v1/cfa/levels/${id}`, {
38
38
  method: "PATCH",
39
39
  body,
40
40
  });
41
41
  outputJSON({ status: "ok", data });
42
42
  }
43
- export async function handleExamSubjectDelete(id) {
44
- const { data } = await apiCall(`/api/admin/v1/exam-subjects/${id}`, {
43
+ export async function handleCfaLevelDelete(id) {
44
+ const { data } = await apiCall(`/api/admin/v1/cfa/levels/${id}`, {
45
45
  method: "DELETE",
46
46
  });
47
47
  outputJSON({ status: "ok", data });
48
48
  }
49
- //# sourceMappingURL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