cloudcc-cli 2.3.1 → 2.3.3
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/.claude/settings.json +25 -0
- package/.cloudcc-cache.json +21 -4
- package/.cursor/skills/cloudcc-cli-dev.zip +0 -0
- package/.cursor/skills/cloudcc-cli-usage/SKILL.md +68 -0
- package/README.md +22 -0
- package/bin/cc.js +13 -8
- package/bin/index.js +9 -2
- package/bin/mcp.js +1 -1
- package/build/component-CCPlugin1774500425584.common.js +831 -0
- package/build/component-CCPlugin1774500425584.common.js.map +1 -0
- package/build/component-CCPlugin1774500425584.css +1 -0
- package/build/component-CCPlugin1774500425584.umd.js +874 -0
- package/build/component-CCPlugin1774500425584.umd.js.map +1 -0
- package/build/component-CCPlugin1774500425584.umd.min.js +8 -0
- package/build/component-CCPlugin1774500425584.umd.min.js.map +1 -0
- package/build/demo.html +1 -0
- package/{src/mcp → mcp}/tools/Class Editor Guide/handler.js +12 -4
- package/{src/mcp → mcp}/tools/Component Editor Guide/handler.js +15 -14
- package/{src/mcp → mcp}/tools/Trigger Editor Guide/handler.js +8 -2
- package/package.json +3 -2
- package/src/application/doc.js +46 -0
- package/src/application/docs/devguide.md +173 -0
- package/src/application/docs/introduction.md +81 -0
- package/src/application/index.js +1 -0
- package/src/brief/get.js +1 -1
- package/src/classes/create.js +6 -1
- package/src/classes/delete.js +7 -1
- package/src/classes/detail.js +8 -1
- package/src/classes/doc.js +49 -472
- package/src/classes/docs/devguide.md +541 -0
- package/src/classes/get.js +9 -2
- package/src/classes/index.js +2 -1
- package/src/classes/publish.js +6 -1
- package/src/classes/pull.js +6 -1
- package/src/classes/pullList.js +6 -3
- package/src/config/doc.js +31 -0
- package/src/config/docs/devguide.md +100 -0
- package/src/config/index.js +5 -0
- package/src/customPage/create.js +52 -19
- package/src/customPage/doc.js +46 -0
- package/src/customPage/docs/devguide.md +200 -0
- package/{.cursor/skills/cloudcc-cli-dev/docs//350/207/252/345/256/232/344/271/211/351/241/265/351/235/242.md → src/customPage/docs/introduction.md} +1 -5
- package/src/customPage/index.js +1 -0
- package/src/customSetting/create.js +9 -0
- package/src/customSetting/delete.js +10 -1
- package/src/customSetting/deleteCustomSettingField.js +43 -0
- package/src/customSetting/detail.js +10 -1
- package/src/customSetting/doc.js +22 -179
- package/src/customSetting/docs/devguide.md +181 -0
- package/src/customSetting/docs/introduction.md +3 -0
- package/src/customSetting/editCustomSettingField.js +34 -0
- package/src/customSetting/get.js +9 -0
- package/src/customSetting/index.js +6 -1
- package/src/customSetting/modify.js +30 -0
- package/src/customSetting/saveCustomSettingField.js +46 -0
- package/src/fields/doc.js +45 -0
- package/src/fields/docs/devguide.md +224 -0
- package/src/fields/docs/introduction.md +217 -0
- package/src/fields/index.js +1 -0
- package/src/globalSelectList/create.js +51 -0
- package/src/globalSelectList/delete.js +56 -0
- package/src/globalSelectList/detail.js +45 -0
- package/src/globalSelectList/doc.js +52 -0
- package/src/globalSelectList/docs/devguide.md +153 -0
- package/src/globalSelectList/docs/introduction.md +82 -0
- package/src/globalSelectList/get.js +31 -0
- package/src/globalSelectList/index.js +16 -0
- package/src/menu/create-page.js +43 -6
- package/src/menu/create-script.js +67 -19
- package/src/menu/doc.js +57 -0
- package/src/menu/docs/devguide.md +129 -0
- package/src/menu/docs/introduction.md +99 -0
- package/src/menu/index.js +1 -0
- package/src/menu/validator.js +80 -0
- package/src/object/doc.js +45 -0
- package/src/object/docs/devguide.md +112 -0
- package/src/object/docs/introduction.md +187 -0
- package/src/object/get.js +1 -23
- package/src/object/index.js +1 -0
- package/src/pagelayout/create.js +123 -0
- package/src/pagelayout/delete.js +57 -0
- package/src/pagelayout/doc.js +46 -0
- package/src/pagelayout/docs/devguide.md +83 -0
- package/src/pagelayout/docs/introduction.md +44 -0
- package/src/pagelayout/get.js +46 -0
- package/src/pagelayout/index.js +10 -0
- package/src/plugin/doc.js +43 -863
- package/src/plugin/docs/devguide.md +996 -0
- package/src/profile/create.js +108 -0
- package/src/profile/delete.js +59 -0
- package/src/profile/doc.js +46 -0
- package/src/profile/docs/devguide.md +77 -0
- package/src/profile/docs/introduction.md +123 -0
- package/src/profile/get.js +55 -0
- package/src/profile/index.js +14 -0
- package/src/project/doc.js +39 -372
- package/src/project/docs/devguide.md +359 -0
- package/src/project/docs/introduction.md +3 -0
- package/src/recordType/create.js +77 -0
- package/src/recordType/delete.js +52 -0
- package/src/recordType/doc.js +36 -0
- package/src/recordType/docs/devguide.md +160 -0
- package/src/recordType/docs/introduction.md +53 -0
- package/src/recordType/editInfo.js +39 -0
- package/src/recordType/editSave.js +47 -0
- package/src/recordType/getList.js +31 -0
- package/src/recordType/index.js +16 -3
- package/src/recordType/newInfo.js +39 -0
- package/src/recordType/validDelete.js +91 -0
- package/src/res.md +66 -0
- package/src/role/create.js +153 -0
- package/src/role/delete.js +59 -0
- package/src/role/doc.js +46 -0
- package/src/role/docs/devguide.md +81 -0
- package/src/role/docs/introduction.md +124 -0
- package/src/role/get.js +57 -0
- package/src/role/index.js +10 -0
- package/src/scheduleJob/doc.js +49 -0
- package/src/scheduleJob/docs/devguide.md +79 -0
- package/src/scheduleJob/docs/introduction.md +101 -0
- package/src/scheduleJob/index.js +5 -0
- package/src/script/delete.js +112 -0
- package/src/script/doc.js +31 -245
- package/src/script/docs/devguide.md +290 -0
- package/src/script/docs/introduction.md +48 -0
- package/src/script/index.js +1 -0
- package/src/staticResource/count.js +31 -10
- package/src/staticResource/create.js +97 -0
- package/src/staticResource/delete.js +30 -8
- package/src/staticResource/detail.js +32 -10
- package/src/staticResource/doc.js +21 -88
- package/src/staticResource/docs/devguide.md +157 -0
- package/src/staticResource/docs/introduction.md +3 -0
- package/src/staticResource/get.js +31 -8
- package/src/staticResource/index.js +2 -1
- package/src/timer/create.js +6 -1
- package/src/timer/delete.js +7 -1
- package/src/timer/detail.js +5 -5
- package/src/timer/doc.js +57 -0
- package/{.cursor/skills/cloudcc-cli-dev/docs/cloudcc/345/256/232/346/227/266/344/275/234/344/270/232.md → src/timer/docs/devguide.md} +83 -1
- package/src/timer/get.js +7 -1
- package/src/timer/index.js +3 -1
- package/src/timer/publish.js +6 -1
- package/src/timer/pull.js +6 -1
- package/src/timer/pullList.js +5 -3
- package/src/triggers/detail.js +5 -5
- package/src/triggers/doc.js +49 -364
- package/src/triggers/docs/devguide.md +442 -0
- package/src/triggers/get.js +7 -3
- package/src/triggers/index.js +1 -4
- package/src/triggers/pullList.js +7 -7
- package/src/user/create.js +50 -0
- package/src/user/delete.js +59 -0
- package/src/user/doc.js +46 -0
- package/src/user/docs/devguide.md +122 -0
- package/src/user/docs/introduction.md +124 -0
- package/src/user/get.js +112 -0
- package/src/user/index.js +12 -0
- package/src/user/update.js +96 -0
- package/src/user/view.js +60 -0
- package/test/classes.cli.test.js +7 -4
- package/test/customPage.cli.test.js +96 -0
- package/test/globalSelectList.cli.test.js +94 -0
- package/test/menu-script.cli.test.js +147 -0
- package/test/menu.cli.test.js +8 -1
- package/test/plugin.cli.test.js +5 -3
- package/test/timer.cli.test.js +15 -8
- package/test/trigger.cli.test.js +5 -3
- package/.cursor/skills/cloudcc-cli-dev/BACKEND_CLASS.md +0 -111
- package/.cursor/skills/cloudcc-cli-dev/BACKEND_SCHEDULE.md +0 -152
- package/.cursor/skills/cloudcc-cli-dev/BACKEND_TRIGGER.md +0 -150
- package/.cursor/skills/cloudcc-cli-dev/CLI_CHEATSHEET.md +0 -372
- package/.cursor/skills/cloudcc-cli-dev/CUSTOM-SETTING-API.md +0 -62
- package/.cursor/skills/cloudcc-cli-dev/INSTALL_AND_BOOTSTRAP.md +0 -62
- package/.cursor/skills/cloudcc-cli-dev/OBJECTS_AND_FIELDS.md +0 -214
- package/.cursor/skills/cloudcc-cli-dev/REQUIREMENTS_BREAKDOWN.md +0 -113
- package/.cursor/skills/cloudcc-cli-dev/SKILL.md +0 -66
- package/.cursor/skills/cloudcc-cli-dev/STATIC-RESOURCE-API.md +0 -60
- package/.cursor/skills/cloudcc-cli-dev/VUE_CUSTOM_COMPONENT.md +0 -151
- package/.cursor/skills/cloudcc-cli-dev/VUE_CUSTOM_PAGE.md +0 -216
- package/src/approval/approve.js +0 -105
- package/src/approval/get.js +0 -245
- package/src/approval/index.js +0 -11
- package/src/approval/reject.js +0 -105
- package/src/plugin/readme.md +0 -7
- /package/{src/mcp → mcp}/cliRunner.js +0 -0
- /package/{src/mcp → mcp}/index.js +0 -0
- /package/{src/mcp → mcp}/readme.md +0 -0
- /package/{src/mcp → mcp}/tools/Application Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Approval/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Class Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Class Detail Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Class List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Class Publisher/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Class Puller/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Client Script Detail Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Client Script Editor Guide/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Client Script List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Client Script Publisher/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Client Script Puller/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/CloudCC Development Overview/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Component Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Component Detail Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Component List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Component Publisher/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Component Puller/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Dev Environment Creator/fetcher.js +0 -0
- /package/{src/mcp → mcp}/tools/Dev Environment Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Dev Environment Validator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Developer Key Setup Guide/fetcher.js +0 -0
- /package/{src/mcp → mcp}/tools/Developer Key Setup Guide/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/JSP Migrator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Menu Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Object Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Object Fields Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Object Fields Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Object List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Scheduled Class Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Scheduled Class Detail Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Scheduled Class List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Scheduled Class Publisher/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Scheduled Class Puller/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Trigger Creator/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Trigger Detail Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Trigger List Retriever/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Trigger Publisher/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/Trigger Puller/handler.js +0 -0
- /package/{src/mcp → mcp}/tools/index.js +0 -0
- /package/{.cursor/skills/cloudcc-cli-dev/docs//350/207/252/345/256/232/344/271/211/347/261/273.md" → src/classes/docs/introduction.md} +0 -0
- /package/{.cursor/skills/cloudcc-cli-dev/docs/CloudCC/350/207/252/345/256/232/344/271/211/347/273/204/344/273/266/344/275/277/347/224/250/350/257/264/346/230/216.md" → src/plugin/docs/introduction.md} +0 -0
- /package/{.cursor/skills/cloudcc-cli-dev/docs/cloudcc/345/256/232/346/227/266/347/261/273.md" → src/timer/docs/introduction.md} +0 -0
- /package/{.cursor/skills/cloudcc-cli-dev/docs//350/247/246/345/217/221/345/231/250/347/261/273.md" → src/triggers/docs/introduction.md} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# CloudCC 记录类型能力与适用场景说明
|
|
2
|
+
|
|
3
|
+
## 1. 什么是记录类型
|
|
4
|
+
|
|
5
|
+
记录类型(Record Type)是 CloudCC 平台提供的一种**按业务场景差异化展示页面布局和选项列表值**的机制。
|
|
6
|
+
|
|
7
|
+
- 同一对象的不同记录可属于不同的记录类型
|
|
8
|
+
- 不同记录类型可对应不同的**页面布局**(字段展示顺序、是否显示等)
|
|
9
|
+
- 不同记录类型可对应不同的**选项列表可选值**(同一字段在不同记录类型下展示不同选项)
|
|
10
|
+
- 可按**简档**设置哪些用户可以使用该记录类型,以及默认记录类型
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 2. 核心价值
|
|
15
|
+
|
|
16
|
+
| 业务场景 | 说明 |
|
|
17
|
+
|----------------------------------|------------------------------------------------------------|
|
|
18
|
+
| 多业务线共用同一对象 | 如销售合同与服务合同同属"合同"对象,展示不同字段布局 |
|
|
19
|
+
| 不同角色看到不同选项 | 销售人员和客服人员在同一字段看到不同的下拉选项 |
|
|
20
|
+
| 简档隔离 | 控制哪些简档用户能创建/使用某种记录类型 |
|
|
21
|
+
| 标准化业务流程 | 强制不同业务线使用特定字段集,减少误操作 |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 3. 核心概念
|
|
26
|
+
|
|
27
|
+
### 3.1 主记录类型(--主--)
|
|
28
|
+
|
|
29
|
+
系统默认记录类型,新建记录类型时可选择继承主类型的选项列表值作为初始值集。
|
|
30
|
+
|
|
31
|
+
### 3.2 简档与记录类型分配
|
|
32
|
+
|
|
33
|
+
每个记录类型可分配给一个或多个简档:
|
|
34
|
+
- `isActive`:该简档是否启用此记录类型
|
|
35
|
+
- `isDefault`:是否将此记录类型设为该简档的默认值
|
|
36
|
+
- `layoutid`:该简档下使用的页面布局
|
|
37
|
+
|
|
38
|
+
### 3.3 删除替换机制
|
|
39
|
+
|
|
40
|
+
删除记录类型时,系统会要求指定**替换记录类型**:
|
|
41
|
+
- 所有使用被删除记录类型的现有记录将被替换为目标记录类型
|
|
42
|
+
- 若不需要替换,可传 `replaceId: ""`(选择"--无--")
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 4. 入口
|
|
47
|
+
|
|
48
|
+
进入路径:`对象管理 → 选择对象 → 记录类型` 标签页
|
|
49
|
+
|
|
50
|
+
主要操作:
|
|
51
|
+
- **新建**:创建新的记录类型
|
|
52
|
+
- **排序**:调整记录类型显示顺序
|
|
53
|
+
- **页面布局分配**:批量管理简档与页面布局的对应关系
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { getPackageJson } = require("../../utils/config");
|
|
2
|
+
const { postClass } = require("../../utils/http");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* cc editInfo recordType <projectPath> <encodedBodyJson>
|
|
6
|
+
* 获取编辑记录类型的回显数据
|
|
7
|
+
*
|
|
8
|
+
* encodedBodyJson(encodeURI 编码前)示例:
|
|
9
|
+
* { "id": "2026667B898023FoKwCe", "objid": "202646FC67ACF24D39sG" }
|
|
10
|
+
*
|
|
11
|
+
* @param {string} projectPath
|
|
12
|
+
* @param {string} encodedBodyJson
|
|
13
|
+
* @param {boolean} isMcp
|
|
14
|
+
*/
|
|
15
|
+
async function editInfo(projectPath = process.cwd(), encodedBodyJson, isMcp = false) {
|
|
16
|
+
if (!encodedBodyJson) {
|
|
17
|
+
throw new Error("Get Edit Record Type Info Failed: encodedBodyJson is required");
|
|
18
|
+
}
|
|
19
|
+
const body = JSON.parse(decodeURI(encodedBodyJson));
|
|
20
|
+
if (!body.id || !body.objid) {
|
|
21
|
+
throw new Error("Get Edit Record Type Info Failed: id and objid are required");
|
|
22
|
+
}
|
|
23
|
+
const config = await getPackageJson(projectPath);
|
|
24
|
+
const res = await postClass(
|
|
25
|
+
config.setupSvc + "/api/recordType/editRecordType",
|
|
26
|
+
body,
|
|
27
|
+
config.accessToken
|
|
28
|
+
);
|
|
29
|
+
if (res && res.result) {
|
|
30
|
+
const data = res.data || {};
|
|
31
|
+
if (!isMcp) {
|
|
32
|
+
console.log(JSON.stringify(data));
|
|
33
|
+
}
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Get Edit Record Type Info Failed: " + (res?.returnInfo || res?.message || "Unknown error"));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = editInfo;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const chalk = require("chalk");
|
|
2
|
+
const { getPackageJson } = require("../../utils/config");
|
|
3
|
+
const { postClass } = require("../../utils/http");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* cc editSave recordType <projectPath> <encodedBodyJson>
|
|
7
|
+
* 保存编辑后的记录类型(将 editInfo 返回的对象修改后提交)
|
|
8
|
+
*
|
|
9
|
+
* encodedBodyJson(encodeURI 编码前)为 editInfo 接口返回的 data 对象,
|
|
10
|
+
* 修改所需字段(name / description / apiCode / isenable)后提交。
|
|
11
|
+
*
|
|
12
|
+
* 只可编辑四个字段:记录类型标签(name)、描述(description)、唯一名称(apiCode)、启用(isenable)
|
|
13
|
+
*
|
|
14
|
+
* @param {string} projectPath
|
|
15
|
+
* @param {string} encodedBodyJson
|
|
16
|
+
* @param {boolean} isMcp
|
|
17
|
+
*/
|
|
18
|
+
async function editSave(projectPath = process.cwd(), encodedBodyJson, isMcp = false) {
|
|
19
|
+
if (!encodedBodyJson) {
|
|
20
|
+
throw new Error("Edit Save Record Type Failed: encodedBodyJson is required");
|
|
21
|
+
}
|
|
22
|
+
const body = JSON.parse(decodeURI(encodedBodyJson));
|
|
23
|
+
if (!body.id) {
|
|
24
|
+
throw new Error("Edit Save Record Type Failed: id is required");
|
|
25
|
+
}
|
|
26
|
+
const config = await getPackageJson(projectPath);
|
|
27
|
+
if (!isMcp) {
|
|
28
|
+
console.error();
|
|
29
|
+
console.error(chalk.green(`Saving record type (${body.id}), please wait...`));
|
|
30
|
+
console.error();
|
|
31
|
+
}
|
|
32
|
+
const res = await postClass(
|
|
33
|
+
config.setupSvc + "/api/recordType/editSave",
|
|
34
|
+
body,
|
|
35
|
+
config.accessToken
|
|
36
|
+
);
|
|
37
|
+
if (res && res.result) {
|
|
38
|
+
if (!isMcp) {
|
|
39
|
+
console.error(chalk.green("Success! Record type updated."));
|
|
40
|
+
console.error();
|
|
41
|
+
}
|
|
42
|
+
return res;
|
|
43
|
+
}
|
|
44
|
+
throw new Error("Edit Save Record Type Failed: " + (res?.returnInfo || res?.message || "Unknown error"));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = editSave;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const { getPackageJson } = require("../../utils/config");
|
|
2
|
+
const { postClass } = require("../../utils/http");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* cc getList recordType <projectPath> <objid>
|
|
6
|
+
* 获取指定对象的记录类型列表
|
|
7
|
+
* @param {string} projectPath
|
|
8
|
+
* @param {string} objid 对象 ID
|
|
9
|
+
* @param {boolean} isMcp
|
|
10
|
+
*/
|
|
11
|
+
async function getList(projectPath = process.cwd(), objid, isMcp = false) {
|
|
12
|
+
if (!objid) {
|
|
13
|
+
throw new Error("Get Record Type List Failed: objid is required");
|
|
14
|
+
}
|
|
15
|
+
const config = await getPackageJson(projectPath);
|
|
16
|
+
const res = await postClass(
|
|
17
|
+
config.setupSvc + "/api/recordType/getRecordTypeList",
|
|
18
|
+
{ id: "", profileId: "", objid },
|
|
19
|
+
config.accessToken
|
|
20
|
+
);
|
|
21
|
+
if (res && res.result) {
|
|
22
|
+
const data = res.data || {};
|
|
23
|
+
if (!isMcp) {
|
|
24
|
+
console.log(JSON.stringify(data));
|
|
25
|
+
}
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
throw new Error("Get Record Type List Failed: " + (res?.returnInfo || res?.message || "Unknown error"));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = getList;
|
package/src/recordType/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
const cc = {}
|
|
2
|
-
cc.get = require("./get")
|
|
1
|
+
const cc = {};
|
|
2
|
+
cc.get = require("./get");
|
|
3
|
+
cc.getList = require("./getList");
|
|
4
|
+
cc.newInfo = require("./newInfo");
|
|
5
|
+
cc.create = require("./create");
|
|
6
|
+
cc.editInfo = require("./editInfo");
|
|
7
|
+
cc.editSave = require("./editSave");
|
|
8
|
+
cc.validDelete = require("./validDelete");
|
|
9
|
+
cc.delete = require("./delete");
|
|
10
|
+
cc.doc = require("./doc");
|
|
11
|
+
|
|
3
12
|
function main(action, argvs) {
|
|
4
|
-
|
|
13
|
+
if (action === "doc") {
|
|
14
|
+
cc.doc(argvs);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
cc[action](argvs[2], argvs[3], argvs[4]);
|
|
5
18
|
}
|
|
6
19
|
|
|
7
20
|
module.exports = main;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const { getPackageJson } = require("../../utils/config");
|
|
2
|
+
const { postClass } = require("../../utils/http");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* cc newInfo recordType <projectPath> <objid>
|
|
6
|
+
* 获取新建记录类型所需的表单初始信息(现有记录类型列表、简档列表、页面布局列表)
|
|
7
|
+
* @param {string} projectPath
|
|
8
|
+
* @param {string} objid 对象 ID
|
|
9
|
+
* @param {boolean} isMcp
|
|
10
|
+
*/
|
|
11
|
+
async function newInfo(projectPath = process.cwd(), objid, isMcp = false) {
|
|
12
|
+
if (!objid) {
|
|
13
|
+
throw new Error("Get New Record Type Info Failed: objid is required");
|
|
14
|
+
}
|
|
15
|
+
const config = await getPackageJson(projectPath);
|
|
16
|
+
const res = await postClass(
|
|
17
|
+
config.setupSvc + "/api/recordType/newRecordType",
|
|
18
|
+
{ objid },
|
|
19
|
+
config.accessToken
|
|
20
|
+
);
|
|
21
|
+
if (res && res.result) {
|
|
22
|
+
const data = res.data || {};
|
|
23
|
+
// 提取关键字段便于使用
|
|
24
|
+
const result = {
|
|
25
|
+
existsRectypeList: data.existsRectypeList || [],
|
|
26
|
+
profilemap: data.profilemap || {},
|
|
27
|
+
layouts: data.layouts || [],
|
|
28
|
+
profileRecordtypes: data.profileRecordtypes || {},
|
|
29
|
+
slist: data.slist || []
|
|
30
|
+
};
|
|
31
|
+
if (!isMcp) {
|
|
32
|
+
console.log(JSON.stringify(result));
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
throw new Error("Get New Record Type Info Failed: " + (res?.returnInfo || res?.message || "Unknown error"));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = newInfo;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const chalk = require("chalk");
|
|
2
|
+
const { getPackageJson } = require("../../utils/config");
|
|
3
|
+
const { postClass } = require("../../utils/http");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* cc validDelete recordType <projectPath> <encodedBodyJson>
|
|
7
|
+
* 删除前校验:获取可替换的记录类型列表
|
|
8
|
+
*
|
|
9
|
+
* 执行逻辑:
|
|
10
|
+
* 1. 先调用 editRecordType 获取当前记录类型数据
|
|
11
|
+
* 2. 若当前为启用状态(isenable !== "false"),自动调用 editSave 将其禁用
|
|
12
|
+
* 3. 再调用 validDelete 接口获取可替换列表
|
|
13
|
+
*
|
|
14
|
+
* encodedBodyJson(encodeURI 编码前)示例:
|
|
15
|
+
* { "id": "2026667B898023FoKwCe", "objid": "202646FC67ACF24D39sG" }
|
|
16
|
+
*
|
|
17
|
+
* 返回:
|
|
18
|
+
* {
|
|
19
|
+
* obj: { id, name, ... }, // 待删除的记录类型基本信息
|
|
20
|
+
* recordtypes: [ { id, name } ] // 可作为替换目标的记录类型列表(含"--无--")
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* @param {string} projectPath
|
|
24
|
+
* @param {string} encodedBodyJson
|
|
25
|
+
* @param {boolean} isMcp
|
|
26
|
+
*/
|
|
27
|
+
async function validDelete(projectPath = process.cwd(), encodedBodyJson, isMcp = false) {
|
|
28
|
+
if (!encodedBodyJson) {
|
|
29
|
+
throw new Error("Valid Delete Record Type Failed: encodedBodyJson is required");
|
|
30
|
+
}
|
|
31
|
+
const body = JSON.parse(decodeURI(encodedBodyJson));
|
|
32
|
+
if (!body.id || !body.objid) {
|
|
33
|
+
throw new Error("Valid Delete Record Type Failed: id and objid are required");
|
|
34
|
+
}
|
|
35
|
+
const config = await getPackageJson(projectPath);
|
|
36
|
+
|
|
37
|
+
// Step 1:获取当前记录类型数据
|
|
38
|
+
const editRes = await postClass(
|
|
39
|
+
config.setupSvc + "/api/recordType/editRecordType",
|
|
40
|
+
{ id: body.id, objid: body.objid },
|
|
41
|
+
config.accessToken
|
|
42
|
+
);
|
|
43
|
+
if (!editRes || !editRes.result) {
|
|
44
|
+
throw new Error("Valid Delete Record Type Failed: unable to fetch record type detail - " +
|
|
45
|
+
(editRes?.returnInfo || editRes?.message || "Unknown error"));
|
|
46
|
+
}
|
|
47
|
+
const current = editRes.data || {};
|
|
48
|
+
|
|
49
|
+
// Step 2:若当前为启用状态,先禁用
|
|
50
|
+
if (current.isenable !== "false" && current.isenable !== false && current.isenable !== "") {
|
|
51
|
+
if (!isMcp) {
|
|
52
|
+
console.error();
|
|
53
|
+
console.error(chalk.yellow(`Record type (${body.id}) is enabled, disabling before delete...`));
|
|
54
|
+
console.error();
|
|
55
|
+
}
|
|
56
|
+
const disableRes = await postClass(
|
|
57
|
+
config.setupSvc + "/api/recordType/editSave",
|
|
58
|
+
{ ...current, isenable: "false" },
|
|
59
|
+
config.accessToken
|
|
60
|
+
);
|
|
61
|
+
if (!disableRes || !disableRes.result) {
|
|
62
|
+
throw new Error("Valid Delete Record Type Failed: unable to disable record type - " +
|
|
63
|
+
(disableRes?.returnInfo || disableRes?.message || "Unknown error"));
|
|
64
|
+
}
|
|
65
|
+
if (!isMcp) {
|
|
66
|
+
console.error(chalk.green("Record type disabled successfully."));
|
|
67
|
+
console.error();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Step 3:执行删除校验
|
|
72
|
+
const res = await postClass(
|
|
73
|
+
config.setupSvc + "/api/recordType/validDelete",
|
|
74
|
+
body,
|
|
75
|
+
config.accessToken
|
|
76
|
+
);
|
|
77
|
+
if (res && res.result) {
|
|
78
|
+
const data = res.data || {};
|
|
79
|
+
const result = {
|
|
80
|
+
obj: data.obj || {},
|
|
81
|
+
recordtypes: data.recordtypes || []
|
|
82
|
+
};
|
|
83
|
+
if (!isMcp) {
|
|
84
|
+
console.log(JSON.stringify(result));
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
throw new Error("Valid Delete Record Type Failed: " + (res?.returnInfo || res?.message || "Unknown error"));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module.exports = validDelete;
|
package/src/res.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# cloudcc-cli 资源与操作
|
|
2
|
+
|
|
3
|
+
`cc <action> <type> …`
|
|
4
|
+
# CRM 相关
|
|
5
|
+
|
|
6
|
+
## plugin
|
|
7
|
+
* create,publish,get,detail,pull,delete,doc
|
|
8
|
+
|
|
9
|
+
## classes
|
|
10
|
+
* create,publish,pull,get,pullList,detail,delete,doc
|
|
11
|
+
|
|
12
|
+
## customSetting
|
|
13
|
+
* doc,get,create,detail,delete
|
|
14
|
+
|
|
15
|
+
## staticResource
|
|
16
|
+
* doc,get,detail,delete,count
|
|
17
|
+
|
|
18
|
+
## customPage
|
|
19
|
+
* create,delete,get,doc
|
|
20
|
+
|
|
21
|
+
## schedule
|
|
22
|
+
* create,publish,pull,get,pullList,detail,delete,doc
|
|
23
|
+
|
|
24
|
+
## timer
|
|
25
|
+
* create,publish,pull,get,pullList,detail,delete,doc
|
|
26
|
+
|
|
27
|
+
## triggers
|
|
28
|
+
* create,publish,pull,get,pullList,detail,delete,doc
|
|
29
|
+
|
|
30
|
+
## script
|
|
31
|
+
* create,publish,pull,get,pullList,detail,doc
|
|
32
|
+
|
|
33
|
+
## token
|
|
34
|
+
* get
|
|
35
|
+
|
|
36
|
+
## object
|
|
37
|
+
* get,create,delete
|
|
38
|
+
|
|
39
|
+
## recordType
|
|
40
|
+
* get
|
|
41
|
+
|
|
42
|
+
## brief
|
|
43
|
+
* get
|
|
44
|
+
|
|
45
|
+
## fields
|
|
46
|
+
* get,create,delete
|
|
47
|
+
|
|
48
|
+
## menu
|
|
49
|
+
* create,delete,get,doc
|
|
50
|
+
|
|
51
|
+
## application
|
|
52
|
+
* get,create,delete
|
|
53
|
+
|
|
54
|
+
## scheduleJob
|
|
55
|
+
* get,detail,delete,doc
|
|
56
|
+
|
|
57
|
+
# CLI 相关
|
|
58
|
+
|
|
59
|
+
## project
|
|
60
|
+
* create,doc
|
|
61
|
+
|
|
62
|
+
## config
|
|
63
|
+
* use,get
|
|
64
|
+
|
|
65
|
+
## version
|
|
66
|
+
* get
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const inquirer = require('inquirer');
|
|
3
|
+
const { postClass } = require("../../utils/http");
|
|
4
|
+
const { getPackageJson } = require("../../utils/config");
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 创建角色
|
|
8
|
+
* 用法:cc create role <path> <roleName> [parentRoleName] [description]
|
|
9
|
+
* 流程:
|
|
10
|
+
* 1. 调用 role/addRole 获取直属上司列表
|
|
11
|
+
* 2. 交互式选择直属上司(未指定时)或自动匹配(指定时)
|
|
12
|
+
* 3. 调用 role/saveRole 保存新角色
|
|
13
|
+
* @param {Array} argvs - 命令行参数数组
|
|
14
|
+
* @returns {Promise<Object>} 创建结果
|
|
15
|
+
*/
|
|
16
|
+
async function create(argvs) {
|
|
17
|
+
try {
|
|
18
|
+
// 命令行参数格式:cc create role <path> <roleName> [parentRoleName] [description]
|
|
19
|
+
const projectPath = argvs[2] || process.cwd();
|
|
20
|
+
const roleName = argvs[3];
|
|
21
|
+
const parentRoleName = argvs[4] || '';
|
|
22
|
+
const description = argvs[5] || '';
|
|
23
|
+
|
|
24
|
+
if (!roleName) {
|
|
25
|
+
console.error();
|
|
26
|
+
console.error(chalk.red('Error: 缺少角色名称'));
|
|
27
|
+
console.error('用法: cc create role <path> <roleName> [parentRoleName] [description]');
|
|
28
|
+
console.error('示例:');
|
|
29
|
+
console.error(' cc create role . "销售经理" # 交互式选择直属上司');
|
|
30
|
+
console.error(' cc create role . "销售经理" "CEO" # 指定直属上司为 CEO');
|
|
31
|
+
console.error(' cc create role . "销售经理" "CEO" "负责销售团队管理"');
|
|
32
|
+
console.error();
|
|
33
|
+
throw new Error('缺少必需参数: roleName');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const config = await getPackageJson(projectPath);
|
|
37
|
+
if (!config || !config.accessToken) {
|
|
38
|
+
console.error();
|
|
39
|
+
console.error(chalk.red('Error: 配置未找到或 accessToken 缺失'));
|
|
40
|
+
console.error();
|
|
41
|
+
throw new Error('配置未找到或 accessToken 缺失');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.error();
|
|
45
|
+
console.error(chalk.green(`Creating role (${roleName}), please wait...`));
|
|
46
|
+
console.error();
|
|
47
|
+
|
|
48
|
+
// 步骤1:调用 addRole 获取直属上司列表
|
|
49
|
+
console.error(chalk.blue('Step 1: 获取直属上司列表...'));
|
|
50
|
+
const addRoleRes = await postClass(
|
|
51
|
+
config.setupSvc + "/api/role/addRole",
|
|
52
|
+
{ id: "bab2025F8B20EE4d4005" },
|
|
53
|
+
config.accessToken
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
if (!addRoleRes || !addRoleRes.result) {
|
|
57
|
+
const msg = addRoleRes && (addRoleRes.returnInfo || addRoleRes.message)
|
|
58
|
+
? (addRoleRes.returnInfo || addRoleRes.message)
|
|
59
|
+
: "获取直属上司列表失败";
|
|
60
|
+
throw new Error(msg);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const supervisorList = addRoleRes.data?.flist || [];
|
|
64
|
+
if (supervisorList.length === 0) {
|
|
65
|
+
throw new Error('没有可用的直属上司角色');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let parentRoleId;
|
|
69
|
+
|
|
70
|
+
// 步骤2:确定直属上司
|
|
71
|
+
if (parentRoleName) {
|
|
72
|
+
// 通过名称自动匹配上级角色
|
|
73
|
+
const matchedSupervisor = supervisorList.find(
|
|
74
|
+
item => item.rolename === parentRoleName
|
|
75
|
+
);
|
|
76
|
+
if (!matchedSupervisor) {
|
|
77
|
+
console.error();
|
|
78
|
+
console.error(chalk.yellow(`警告: 未找到直属上司 "${parentRoleName}"`));
|
|
79
|
+
console.error(chalk.blue('可用的直属上司列表:'));
|
|
80
|
+
supervisorList.forEach(item => {
|
|
81
|
+
console.error(` - ${item.rolename}`);
|
|
82
|
+
});
|
|
83
|
+
console.error();
|
|
84
|
+
throw new Error(`未找到直属上司: ${parentRoleName}`);
|
|
85
|
+
}
|
|
86
|
+
parentRoleId = matchedSupervisor.id;
|
|
87
|
+
console.error(chalk.blue(`已指定直属上司: ${matchedSupervisor.rolename} (${parentRoleId})`));
|
|
88
|
+
} else {
|
|
89
|
+
// 交互式选择直属上司
|
|
90
|
+
const supervisorChoices = supervisorList.map(item => ({
|
|
91
|
+
name: `${item.rolename} (${item.id})`,
|
|
92
|
+
value: item.id,
|
|
93
|
+
short: item.rolename
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
const result = await inquirer.prompt([
|
|
97
|
+
{
|
|
98
|
+
type: 'list',
|
|
99
|
+
name: 'parentRoleId',
|
|
100
|
+
message: '请选择直属上司:',
|
|
101
|
+
choices: supervisorChoices,
|
|
102
|
+
pageSize: 10
|
|
103
|
+
}
|
|
104
|
+
]);
|
|
105
|
+
parentRoleId = result.parentRoleId;
|
|
106
|
+
const selectedSupervisor = supervisorList.find(item => item.id === parentRoleId);
|
|
107
|
+
console.error(chalk.blue(`已选择直属上司: ${selectedSupervisor.rolename} (${parentRoleId})`));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
console.error();
|
|
111
|
+
|
|
112
|
+
// 步骤3:调用 saveRole 保存角色
|
|
113
|
+
console.error(chalk.blue('Step 2: 保存新角色...'));
|
|
114
|
+
const dataJson = JSON.stringify({
|
|
115
|
+
rolename: roleName,
|
|
116
|
+
parentroleId: parentRoleId
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
const saveRes = await postClass(
|
|
120
|
+
config.setupSvc + "/api/role/saveRole",
|
|
121
|
+
{ dataJson },
|
|
122
|
+
config.accessToken
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
if (saveRes && saveRes.result) {
|
|
126
|
+
console.error();
|
|
127
|
+
console.error(chalk.green('Success! Role created.'));
|
|
128
|
+
console.error(` 角色名称: ${roleName}`);
|
|
129
|
+
const selectedSupervisor = supervisorList.find(item => item.id === parentRoleId);
|
|
130
|
+
console.error(` 直属上司: ${selectedSupervisor ? selectedSupervisor.rolename : parentRoleId}`);
|
|
131
|
+
if (saveRes.data) {
|
|
132
|
+
const roleId = typeof saveRes.data === 'object'
|
|
133
|
+
? (saveRes.data.roleid || saveRes.data.id || JSON.stringify(saveRes.data))
|
|
134
|
+
: saveRes.data;
|
|
135
|
+
console.error(` 角色ID: ${roleId}`);
|
|
136
|
+
}
|
|
137
|
+
console.error();
|
|
138
|
+
return saveRes;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const msg = saveRes && (saveRes.returnInfo || saveRes.message)
|
|
142
|
+
? (saveRes.returnInfo || saveRes.message)
|
|
143
|
+
: "Unknown error";
|
|
144
|
+
throw new Error("Save Role Failed: " + msg);
|
|
145
|
+
|
|
146
|
+
} catch (error) {
|
|
147
|
+
console.error();
|
|
148
|
+
console.error(chalk.red("角色创建失败:"), error.message || error);
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
module.exports = create;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const chalk = require("chalk");
|
|
2
|
+
const { postClass } = require("../../utils/http");
|
|
3
|
+
const { getPackageJson } = require("../../utils/config");
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 删除角色
|
|
7
|
+
* 用法:cc delete role <projectPath> <roleId>
|
|
8
|
+
*/
|
|
9
|
+
async function remove(argvs) {
|
|
10
|
+
try {
|
|
11
|
+
const projectPath = argvs[2] || process.cwd();
|
|
12
|
+
const roleId = argvs[3];
|
|
13
|
+
|
|
14
|
+
if (!roleId) {
|
|
15
|
+
console.error();
|
|
16
|
+
console.error(chalk.red("Error: 缺少角色 ID"));
|
|
17
|
+
console.error(chalk.yellow("用法: cc delete role <projectPath> <roleId>"));
|
|
18
|
+
console.error();
|
|
19
|
+
throw new Error("缺少必需参数: roleId");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const config = await getPackageJson(projectPath);
|
|
23
|
+
if (!config || !config.accessToken) {
|
|
24
|
+
console.error();
|
|
25
|
+
console.error(chalk.red("Error: 配置未找到或 accessToken 缺失"));
|
|
26
|
+
console.error();
|
|
27
|
+
throw new Error("配置未找到或 accessToken 缺失");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.error();
|
|
31
|
+
console.error(chalk.green(`Deleting role (${roleId}), please wait...`));
|
|
32
|
+
console.error();
|
|
33
|
+
|
|
34
|
+
const result = await postClass(
|
|
35
|
+
config.setupSvc + "/api/role/deleteRole",
|
|
36
|
+
{ roleid: roleId },
|
|
37
|
+
config.accessToken
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (result && result.result) {
|
|
41
|
+
console.error();
|
|
42
|
+
console.error(chalk.green("Success! Role deleted."));
|
|
43
|
+
console.error();
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const msg = result && (result.returnInfo || result.message) ? (result.returnInfo || result.message) : "Unknown error";
|
|
48
|
+
console.error();
|
|
49
|
+
console.error(chalk.red("Error: " + msg));
|
|
50
|
+
console.error();
|
|
51
|
+
throw new Error("Delete Role Failed: " + msg);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error();
|
|
54
|
+
console.error(chalk.red("角色删除失败:"), error);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
module.exports = remove;
|
package/src/role/doc.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* role 文档入口:正文均在 `docs/` 目录。
|
|
3
|
+
*/
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const DOCS_DIR = path.join(__dirname, "docs");
|
|
8
|
+
|
|
9
|
+
function readDocFile(basename) {
|
|
10
|
+
return fs.readFileSync(path.join(DOCS_DIR, `${basename}.md`), "utf8");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** 介绍文档:角色能力、类型与入口 */
|
|
14
|
+
function getIntroductionDoc() {
|
|
15
|
+
return readDocFile("introduction");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 开发指导:CLI 创建/查询/删除等 */
|
|
19
|
+
function getDevGuideDoc() {
|
|
20
|
+
return readDocFile("devguide");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* cc doc role <introduction|devguide>
|
|
25
|
+
* @param {string[]} argvs [doc, type, introduction|devguide, ...]
|
|
26
|
+
*/
|
|
27
|
+
function doc(argvs) {
|
|
28
|
+
const subType = argvs[2];
|
|
29
|
+
const key = String(subType || "").trim().toLowerCase();
|
|
30
|
+
if (!key) {
|
|
31
|
+
throw new Error("cc doc role 需要子命令:introduction 或 devguide");
|
|
32
|
+
}
|
|
33
|
+
if (key === "introduction") {
|
|
34
|
+
const content = getIntroductionDoc();
|
|
35
|
+
console.log(content);
|
|
36
|
+
return content;
|
|
37
|
+
}
|
|
38
|
+
if (key === "devguide") {
|
|
39
|
+
const content = getDevGuideDoc();
|
|
40
|
+
console.log(content);
|
|
41
|
+
return content;
|
|
42
|
+
}
|
|
43
|
+
throw new Error(`doc 不支持的子命令: ${subType},请使用 introduction 或 devguide`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = doc;
|