cloudcc-cli 2.3.5 → 2.3.7
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/.cursor/skills/cloudcc-cli-dev/SKILL.md +29 -23
- package/.cursor/skills/cloudcc-dev-skill/SKILL.md +26 -26
- package/README.md +68 -13
- package/bin/cc.js +6 -6
- package/mcp/cliRunner.js +2 -2
- package/mcp/tools/Application Creator/handler.js +1 -1
- package/mcp/tools/Approval/handler.js +3 -3
- package/mcp/tools/Class Creator/handler.js +2 -2
- package/mcp/tools/Class Detail Retriever/handler.js +1 -1
- package/mcp/tools/Class Editor Guide/handler.js +1 -1
- package/mcp/tools/Class List Retriever/handler.js +1 -1
- package/mcp/tools/Class Publisher/handler.js +1 -1
- package/mcp/tools/Class Puller/handler.js +1 -1
- package/mcp/tools/Client Script Detail Retriever/handler.js +1 -1
- package/mcp/tools/Client Script Editor Guide/handler.js +1 -1
- package/mcp/tools/Client Script List Retriever/handler.js +1 -1
- package/mcp/tools/Client Script Publisher/handler.js +1 -1
- package/mcp/tools/Client Script Puller/handler.js +2 -2
- package/mcp/tools/CloudCC Development Overview/handler.js +1 -1
- package/mcp/tools/Component Creator/handler.js +1 -1
- package/mcp/tools/Component Detail Retriever/handler.js +1 -1
- package/mcp/tools/Component Editor Guide/handler.js +1 -1
- package/mcp/tools/Component List Retriever/handler.js +1 -1
- package/mcp/tools/Component Publisher/handler.js +2 -2
- package/mcp/tools/Component Puller/handler.js +1 -1
- package/mcp/tools/Dev Environment Creator/handler.js +1 -1
- package/mcp/tools/Dev Environment Validator/handler.js +1 -1
- package/mcp/tools/Developer Key Setup Guide/handler.js +1 -1
- package/mcp/tools/Menu Creator/handler.js +1 -1
- package/mcp/tools/Object Creator/handler.js +2 -2
- package/mcp/tools/Object Fields Creator/handler.js +1 -1
- package/mcp/tools/Object Fields Retriever/handler.js +1 -1
- package/mcp/tools/Object List Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class Creator/handler.js +1 -1
- package/mcp/tools/Scheduled Class Detail Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class List Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class Publisher/handler.js +1 -1
- package/mcp/tools/Scheduled Class Puller/handler.js +1 -1
- package/mcp/tools/Trigger Creator/handler.js +1 -1
- package/mcp/tools/Trigger Detail Retriever/handler.js +1 -1
- package/mcp/tools/Trigger Editor Guide/handler.js +1 -1
- package/mcp/tools/Trigger List Retriever/handler.js +1 -1
- package/mcp/tools/Trigger Publisher/handler.js +1 -1
- package/mcp/tools/Trigger Puller/handler.js +1 -1
- package/package.json +4 -2
- package/src/application/create.js +2 -2
- package/src/application/delete.js +2 -2
- package/src/application/doc.js +2 -2
- package/src/application/docs/devguide.md +25 -25
- package/src/application/docs/introduction.md +2 -2
- package/src/button/create.js +1 -1
- package/src/button/delete.js +1 -1
- package/src/button/doc.js +2 -2
- package/src/button/docs/devguide.md +11 -11
- package/src/button/get.js +1 -1
- package/src/button/index.js +1 -1
- package/src/classes/create.js +1 -1
- package/src/classes/delete.js +1 -1
- package/src/classes/detail.js +1 -1
- package/src/classes/doc.js +2 -2
- package/src/classes/docs/devguide.md +21 -21
- package/src/classes/get.js +1 -1
- package/src/classes/publish.js +1 -1
- package/src/classes/pull.js +1 -1
- package/src/classes/pullList.js +1 -1
- package/src/config/doc.js +2 -2
- package/src/config/docs/devguide.md +15 -15
- package/src/customPage/create.js +2 -2
- package/src/customPage/delete.js +2 -2
- package/src/customPage/doc.js +2 -2
- package/src/customPage/docs/devguide.md +27 -27
- package/src/customPage/get.js +1 -1
- package/src/customSetting/create.js +1 -1
- package/src/customSetting/delete.js +1 -1
- package/src/customSetting/deleteCustomSettingField.js +1 -1
- package/src/customSetting/detail.js +1 -1
- package/src/customSetting/docs/devguide.md +9 -9
- package/src/customSetting/editCustomSettingField.js +1 -1
- package/src/customSetting/get.js +1 -1
- package/src/customSetting/modify.js +1 -1
- package/src/customSetting/saveCustomSettingField.js +1 -1
- package/src/fields/delete.js +2 -2
- package/src/fields/docs/devguide.md +14 -14
- package/src/fields/docs/introduction.md +3 -3
- package/src/globalSelectList/create.js +1 -1
- package/src/globalSelectList/delete.js +1 -1
- package/src/globalSelectList/detail.js +1 -1
- package/src/globalSelectList/doc.js +2 -2
- package/src/globalSelectList/docs/devguide.md +7 -7
- package/src/globalSelectList/get.js +1 -1
- package/src/identityProvider/create.js +3 -3
- package/src/identityProvider/delete.js +3 -3
- package/src/identityProvider/doc.js +2 -2
- package/src/identityProvider/docs/devguide.md +10 -10
- package/src/identityProvider/download.js +1 -1
- package/src/identityProvider/get.js +1 -1
- package/src/menu/create-object.js +2 -2
- package/src/menu/create-page.js +2 -2
- package/src/menu/create-script.js +2 -2
- package/src/menu/create-site.js +2 -2
- package/src/menu/create.js +11 -11
- package/src/menu/delete.js +2 -2
- package/src/menu/doc.js +2 -2
- package/src/menu/docs/devguide.md +13 -13
- package/src/menu/docs/introduction.md +3 -3
- package/src/menu/get.js +1 -1
- package/src/object/create.js +2 -2
- package/src/object/delete.js +2 -2
- package/src/object/docs/devguide.md +11 -11
- package/src/pagelayout/create.js +6 -6
- package/src/pagelayout/delete.js +4 -4
- package/src/pagelayout/doc.js +2 -2
- package/src/pagelayout/docs/devguide.md +9 -9
- package/src/pagelayout/docs/introduction.md +1 -1
- package/src/pagelayout/get.js +4 -4
- package/src/permission/add.js +4 -4
- package/src/permission/assign.js +3 -3
- package/src/permission/docs/devguide.md +20 -20
- package/src/permission/docs/introduction.md +18 -18
- package/src/permission/get.js +1 -1
- package/src/permission/remove.js +4 -4
- package/src/plugin/delete.js +2 -2
- package/src/plugin/doc.js +2 -2
- package/src/plugin/docs/devguide.md +29 -29
- package/src/profile/create.js +5 -5
- package/src/profile/delete.js +2 -2
- package/src/profile/doc.js +2 -2
- package/src/profile/docs/devguide.md +8 -8
- package/src/profile/docs/introduction.md +12 -12
- package/src/profile/get.js +1 -1
- package/src/project/docs/devguide.md +19 -6
- package/src/recordType/create.js +1 -1
- package/src/recordType/delete.js +1 -1
- package/src/recordType/doc.js +2 -2
- package/src/recordType/docs/devguide.md +10 -10
- package/src/recordType/editInfo.js +1 -1
- package/src/recordType/editSave.js +1 -1
- package/src/recordType/getList.js +1 -1
- package/src/recordType/newInfo.js +1 -1
- package/src/recordType/validDelete.js +1 -1
- package/src/res.md +1 -1
- package/src/role/create.js +6 -6
- package/src/role/delete.js +2 -2
- package/src/role/doc.js +2 -2
- package/src/role/docs/devguide.md +9 -9
- package/src/role/docs/introduction.md +13 -13
- package/src/role/get.js +1 -1
- package/src/scheduleJob/doc.js +1 -1
- package/src/scheduleJob/docs/devguide.md +6 -6
- package/src/scheduleJob/docs/introduction.md +6 -6
- package/src/script/docs/devguide.md +18 -18
- package/src/singleSignOn/delete.js +3 -3
- package/src/singleSignOn/doc.js +2 -2
- package/src/singleSignOn/docs/devguide.md +5 -5
- package/src/singleSignOn/get.js +1 -1
- package/src/staticResource/count.js +1 -1
- package/src/staticResource/create.js +1 -1
- package/src/staticResource/delete.js +1 -1
- package/src/staticResource/detail.js +1 -1
- package/src/staticResource/docs/devguide.md +11 -11
- package/src/staticResource/get.js +1 -1
- package/src/timer/create.js +1 -1
- package/src/timer/delete.js +1 -1
- package/src/timer/detail.js +1 -1
- package/src/timer/doc.js +2 -2
- package/src/timer/docs/devguide.md +19 -19
- package/src/timer/get.js +1 -1
- package/src/timer/publish.js +1 -1
- package/src/timer/pull.js +1 -1
- package/src/timer/pullList.js +1 -1
- package/src/triggers/detail.js +1 -1
- package/src/triggers/doc.js +2 -2
- package/src/triggers/docs/devguide.md +23 -23
- package/src/triggers/get.js +1 -1
- package/src/triggers/pullList.js +1 -1
- package/src/user/create.js +2 -2
- package/src/user/delete.js +2 -2
- package/src/user/doc.js +2 -2
- package/src/user/docs/devguide.md +13 -13
- package/src/user/docs/introduction.md +12 -12
- package/src/user/get.js +1 -1
- package/src/user/update.js +3 -3
- package/src/user/view.js +2 -2
- package/src/validationRule/create.js +5 -5
- package/src/validationRule/delete.js +2 -2
- package/src/validationRule/doc.js +2 -2
- package/src/validationRule/docs/devguide.md +7 -7
- package/src/validationRule/docs/introduction.md +11 -11
- package/src/validationRule/get.js +1 -1
- package/src/version/actionHelp.js +3 -3
- package/src/version/doctor.js +1 -1
- package/src/version/get.js +0 -6
- package/src/version/help.js +15 -14
- package/src/version/initHelp.js +2 -2
- package/src/version/listModuleCommands.js +2 -2
- package/src/version/stats.js +1 -1
- package/test/application.cli.test.js +1 -1
- package/test/classes.cli.test.js +1 -1
- package/test/customSetting.cli.test.js +1 -1
- package/test/fields.cli.test.js +2 -2
- package/test/globalSelectList.cli.test.js +1 -1
- package/test/menu-script.cli.test.js +1 -1
- package/test/menu.cli.test.js +1 -1
- package/test/object.cli.test.js +1 -1
- package/test/plugin.cli.test.js +1 -1
- package/test/scheduleJob.cli.test.js +1 -1
- package/test/script.cli.test.js +1 -1
- package/test/staticResource.cli.test.js +1 -1
- package/test/timer.cli.test.js +1 -1
- package/test/trigger.cli.test.js +1 -1
- package/utils/checkVersion.js +9 -13
- package/utils/commandStats.js +7 -7
|
@@ -17,7 +17,7 @@ async function listCustomComponents({ projectPath = process.cwd() }) {
|
|
|
17
17
|
return {
|
|
18
18
|
content: [{
|
|
19
19
|
type: 'text',
|
|
20
|
-
text: `✗ 查询失败: ${run.detail || '
|
|
20
|
+
text: `✗ 查询失败: ${run.detail || 'cloudcc 命令执行失败'}\n\n可能的原因:\n- 项目路径不正确\n- 网络连接问题\n- 服务器API不可用`
|
|
21
21
|
}]
|
|
22
22
|
};
|
|
23
23
|
}
|
|
@@ -22,7 +22,7 @@ async function publishCustomComponent({ componentName, projectPath = process.cwd
|
|
|
22
22
|
return {
|
|
23
23
|
content: [{
|
|
24
24
|
type: 'text',
|
|
25
|
-
text: `✗ 发布失败: ${detail || '
|
|
25
|
+
text: `✗ 发布失败: ${detail || 'cloudcc 命令执行失败'}`
|
|
26
26
|
}]
|
|
27
27
|
};
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ async function publishCustomComponent({ componentName, projectPath = process.cwd
|
|
|
30
30
|
return {
|
|
31
31
|
content: [{
|
|
32
32
|
type: 'text',
|
|
33
|
-
text: `✓ 自定义组件发布成功\n\n调用命令:
|
|
33
|
+
text: `✓ 自定义组件发布成功\n\n调用命令: cloudcc publish plugin ${componentName}\n执行目录: ${resolvedPath}\n组件名称: ${componentName}\n\n执行过程:\n1. 编译 Vue 组件\n2. 收集依赖文件\n3. 上传到 CloudCC 服务器`
|
|
34
34
|
}]
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -34,7 +34,7 @@ async function pullCustomComponent({ componentName, componentId, projectPath = p
|
|
|
34
34
|
return {
|
|
35
35
|
content: [{
|
|
36
36
|
type: 'text',
|
|
37
|
-
text: `✗ 拉取失败: ${buildRunDetail(run) || '
|
|
37
|
+
text: `✗ 拉取失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}`
|
|
38
38
|
}]
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -12,7 +12,7 @@ async function getDevEnvSetup(params = {}) {
|
|
|
12
12
|
try {
|
|
13
13
|
const run = runCcCommand(['doc', 'project', 'dev-env-creator', JSON.stringify(params || {})]);
|
|
14
14
|
if (!run.success) {
|
|
15
|
-
return { content: [{ type: 'text', text: `错误: ${buildRunDetail(run) || '
|
|
15
|
+
return { content: [{ type: 'text', text: `错误: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
16
16
|
}
|
|
17
17
|
return { content: [{ type: 'text', text: run.stdout || '' }] };
|
|
18
18
|
} catch (error) {
|
|
@@ -14,7 +14,7 @@ async function getDevEnvSetup(params = {}) {
|
|
|
14
14
|
try {
|
|
15
15
|
const run = runCcCommand(['doc', 'project', 'dev-env-validator', JSON.stringify(params || {})]);
|
|
16
16
|
if (!run.success) {
|
|
17
|
-
return { content: [{ type: 'text', text: `错误: ${buildRunDetail(run) || '
|
|
17
|
+
return { content: [{ type: 'text', text: `错误: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
18
18
|
}
|
|
19
19
|
return { content: [{ type: 'text', text: run.stdout || '' }] };
|
|
20
20
|
} catch (error) {
|
|
@@ -67,7 +67,7 @@ async function createMenuTool(params = {}) {
|
|
|
67
67
|
return {
|
|
68
68
|
content: [{
|
|
69
69
|
type: 'text',
|
|
70
|
-
text: `⚠ ${resourceTypeName}菜单创建遇到问题\n\n${buildRunDetail(runResult) || '
|
|
70
|
+
text: `⚠ ${resourceTypeName}菜单创建遇到问题\n\n${buildRunDetail(runResult) || 'cloudcc 命令执行失败'}\n\n请检查:\n1. 资源ID是否正确\n2. 标签名称是否符合规范\n3. CloudCC服务器连接是否正常\n4. 项目配置是否正确\n5. 是否有足够的权限创建菜单`
|
|
71
71
|
}]
|
|
72
72
|
};
|
|
73
73
|
}
|
|
@@ -24,7 +24,7 @@ async function createCustomObject(params = {}) {
|
|
|
24
24
|
return {
|
|
25
25
|
content: [{
|
|
26
26
|
type: 'text',
|
|
27
|
-
text: `✗ 自定义对象创建失败: ${detail || '
|
|
27
|
+
text: `✗ 自定义对象创建失败: ${detail || 'cloudcc 命令执行失败'}`
|
|
28
28
|
}]
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -32,7 +32,7 @@ async function createCustomObject(params = {}) {
|
|
|
32
32
|
return {
|
|
33
33
|
content: [{
|
|
34
34
|
type: 'text',
|
|
35
|
-
text: `✓ 自定义对象创建成功!\n\n调用命令:
|
|
35
|
+
text: `✓ 自定义对象创建成功!\n\n调用命令: cloudcc create object ${resolvedPath} ${label}\n项目目录: ${resolvedPath}\n对象标签: ${label}\n\n创建过程:\n1. 生成对象的 schema 文件\n2. 配置对象权限\n3. 部署到 CloudCC 系统`
|
|
36
36
|
}]
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -44,7 +44,7 @@ async function createObjectField(params = {}) {
|
|
|
44
44
|
return {
|
|
45
45
|
content: [{
|
|
46
46
|
type: 'text',
|
|
47
|
-
text: `⚠ 字段创建遇到问题\n\n${buildRunDetail(runResult) || '
|
|
47
|
+
text: `⚠ 字段创建遇到问题\n\n${buildRunDetail(runResult) || 'cloudcc 命令执行失败'}\n\n请检查:\n1. 对象ID是否正确\n2. 字段名称是否符合规范\n3. CloudCC服务器连接是否正常\n4. 项目配置是否正确`
|
|
48
48
|
}]
|
|
49
49
|
};
|
|
50
50
|
}
|
|
@@ -23,7 +23,7 @@ async function getFields(params = {}) {
|
|
|
23
23
|
|
|
24
24
|
const run = runCcJsonCommand(['get', 'fields', resolvedPath, objprefix], { cwd: resolvedPath });
|
|
25
25
|
if (!run.success) {
|
|
26
|
-
return { content: [{ type: 'text', text: `✗ 查询失败: ${run.detail || '
|
|
26
|
+
return { content: [{ type: 'text', text: `✗ 查询失败: ${run.detail || 'cloudcc 命令执行失败'}` }] };
|
|
27
27
|
}
|
|
28
28
|
const res = run.data;
|
|
29
29
|
|
|
@@ -19,7 +19,7 @@ async function listObjects(params = {}) {
|
|
|
19
19
|
}
|
|
20
20
|
const run = runCcJsonCommand(args, { cwd: resolvedPath });
|
|
21
21
|
if (!run.success) {
|
|
22
|
-
return { content: [{ type: 'text', text: `✗ 查询失败: ${run.detail || '
|
|
22
|
+
return { content: [{ type: 'text', text: `✗ 查询失败: ${run.detail || 'cloudcc 命令执行失败'}` }] };
|
|
23
23
|
}
|
|
24
24
|
const objList = run.data || [];
|
|
25
25
|
if (!objList || objList.length === 0) {
|
|
@@ -14,7 +14,7 @@ async function createSchedule({ scheduleName, projectPath = process.cwd() }) {
|
|
|
14
14
|
const resolvedPath = path.resolve(projectPath);
|
|
15
15
|
const run = runCcCommand(['create', 'schedule', scheduleName], { cwd: resolvedPath });
|
|
16
16
|
if (!run.success) {
|
|
17
|
-
return { content: [{ type: 'text', text: `✗ 创建失败: ${buildRunDetail(run) || '
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 创建失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
18
18
|
}
|
|
19
19
|
const schedulePath = path.resolve(projectPath, `schedule/${scheduleName}`);
|
|
20
20
|
return {
|
|
@@ -18,7 +18,7 @@ async function getScheduleDetail({ scheduleName, scheduleId, projectPath = proce
|
|
|
18
18
|
const resolvedPath = path.resolve(projectPath);
|
|
19
19
|
const run = runCcJsonCommand(['detail', 'schedule', scheduleName || '', scheduleId || ''], { cwd: resolvedPath });
|
|
20
20
|
if (!run.success) {
|
|
21
|
-
return { content: [{ type: 'text', text: `✗ 获取失败: ${run.detail || '
|
|
21
|
+
return { content: [{ type: 'text', text: `✗ 获取失败: ${run.detail || 'cloudcc 命令执行失败'}` }] };
|
|
22
22
|
}
|
|
23
23
|
return { content: [{ type: 'text', text: JSON.stringify(run.data, null, 2) }] };
|
|
24
24
|
} catch (error) {
|
|
@@ -14,7 +14,7 @@ async function listSchedules({ projectPath = process.cwd() }) {
|
|
|
14
14
|
const resolvedPath = path.resolve(projectPath);
|
|
15
15
|
const run = runCcJsonCommand(['get', 'schedule'], { cwd: resolvedPath });
|
|
16
16
|
if (!run.success) {
|
|
17
|
-
return { content: [{ type: 'text', text: `获取定时类列表失败: ${run.detail || '
|
|
17
|
+
return { content: [{ type: 'text', text: `获取定时类列表失败: ${run.detail || 'cloudcc 命令执行失败'}` }] };
|
|
18
18
|
}
|
|
19
19
|
const result = run.data || [];
|
|
20
20
|
if (!result.length) {
|
|
@@ -14,7 +14,7 @@ async function publishSchedule({ scheduleName, projectPath = process.cwd() }) {
|
|
|
14
14
|
const resolvedPath = path.resolve(projectPath);
|
|
15
15
|
const run = runCcCommand(['publish', 'schedule', scheduleName], { cwd: resolvedPath });
|
|
16
16
|
if (!run.success) {
|
|
17
|
-
return { content: [{ type: 'text', text: `✗ 发布失败: ${buildRunDetail(run) || '
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 发布失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
18
18
|
}
|
|
19
19
|
return { content: [{ type: 'text', text: `✓ 发布成功!定时类 ${scheduleName} 已发布到服务器` }] };
|
|
20
20
|
} catch (error) {
|
|
@@ -14,7 +14,7 @@ async function pullSchedule({ scheduleName, projectPath = process.cwd() }) {
|
|
|
14
14
|
const resolvedPath = path.resolve(projectPath);
|
|
15
15
|
const run = runCcCommand(['pull', 'schedule', scheduleName], { cwd: resolvedPath });
|
|
16
16
|
if (!run.success) {
|
|
17
|
-
return { content: [{ type: 'text', text: `✗ 拉取失败: ${buildRunDetail(run) || '
|
|
17
|
+
return { content: [{ type: 'text', text: `✗ 拉取失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
18
18
|
}
|
|
19
19
|
return { content: [{ type: 'text', text: `✓ 拉取成功!本地文件已更新: schedule/${scheduleName}/${scheduleName}.java` }] };
|
|
20
20
|
} catch (error) {
|
|
@@ -26,7 +26,7 @@ async function createTrigger({ triggerName, objectName, targetObjectId, triggerT
|
|
|
26
26
|
const resolvedPath = path.resolve(projectPath);
|
|
27
27
|
const run = runCcCommand(['create', 'triggers', encodeURI(JSON.stringify(body))], { cwd: resolvedPath });
|
|
28
28
|
if (!run.success) {
|
|
29
|
-
return { content: [{ type: 'text', text: `✗ 创建失败: ${buildRunDetail(run) || '
|
|
29
|
+
return { content: [{ type: 'text', text: `✗ 创建失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
30
30
|
}
|
|
31
31
|
const triggerPath = path.resolve(projectPath, `triggers/${objectName.toLowerCase()}/${triggerName}`);
|
|
32
32
|
return {
|
|
@@ -18,7 +18,7 @@ async function getTriggerDetail({ triggerPath, triggerId, projectPath = process.
|
|
|
18
18
|
const resolvedPath = path.resolve(projectPath);
|
|
19
19
|
const run = runCcJsonCommand(['detail', 'triggers', triggerPath || '', triggerId || ''], { cwd: resolvedPath });
|
|
20
20
|
if (!run.success) {
|
|
21
|
-
return { content: [{ type: 'text', text: `✗ 获取失败: ${run.detail || '
|
|
21
|
+
return { content: [{ type: 'text', text: `✗ 获取失败: ${run.detail || 'cloudcc 命令执行失败'}` }] };
|
|
22
22
|
}
|
|
23
23
|
return { content: [{ type: 'text', text: JSON.stringify(run.data, null, 2) }] };
|
|
24
24
|
} catch (error) {
|
|
@@ -21,7 +21,7 @@ async function editTrigger({ topic = 'devguide' }) {
|
|
|
21
21
|
try {
|
|
22
22
|
const run = runCcCommand(['doc', 'triggers', normalizeDocTopic(topic)]);
|
|
23
23
|
if (!run.success) {
|
|
24
|
-
return { content: [{ type: 'text', text: `✗ 获取触发器编辑指南失败: ${buildRunDetail(run) || '
|
|
24
|
+
return { content: [{ type: 'text', text: `✗ 获取触发器编辑指南失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
25
25
|
}
|
|
26
26
|
return {
|
|
27
27
|
content: [{
|
|
@@ -30,7 +30,7 @@ async function listTriggers({ triggerName = '', targetObjectId = '', projectPath
|
|
|
30
30
|
if (!run.success) {
|
|
31
31
|
return {
|
|
32
32
|
content: [
|
|
33
|
-
{ type: 'text', text: `获取触发器列表失败: ${run.detail || '
|
|
33
|
+
{ type: 'text', text: `获取触发器列表失败: ${run.detail || 'cloudcc 命令执行失败'}` }
|
|
34
34
|
]
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -17,7 +17,7 @@ async function publishTrigger({ triggerPath, projectPath = process.cwd() }) {
|
|
|
17
17
|
const resolvedPath = path.resolve(projectPath);
|
|
18
18
|
const run = runCcCommand(['publish', 'triggers', triggerPath], { cwd: resolvedPath });
|
|
19
19
|
if (!run.success) {
|
|
20
|
-
return { content: [{ type: 'text', text: `✗ 发布失败: ${buildRunDetail(run) || '
|
|
20
|
+
return { content: [{ type: 'text', text: `✗ 发布失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
21
21
|
}
|
|
22
22
|
const triggerName = triggerPath.split("/")[1];
|
|
23
23
|
return { content: [{ type: 'text', text: `✓ 发布成功!触发器 ${triggerName} 已发布到服务器` }] };
|
|
@@ -17,7 +17,7 @@ async function pullTrigger({ id, projectPath = process.cwd() }) {
|
|
|
17
17
|
const resolvedPath = path.resolve(projectPath);
|
|
18
18
|
const run = runCcCommand(['pullList', 'triggers', id, resolvedPath], { cwd: resolvedPath });
|
|
19
19
|
if (!run.success) {
|
|
20
|
-
return { content: [{ type: 'text', text: `✗ 拉取失败: ${buildRunDetail(run) || '
|
|
20
|
+
return { content: [{ type: 'text', text: `✗ 拉取失败: ${buildRunDetail(run) || 'cloudcc 命令执行失败'}` }] };
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
23
|
content: [{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcc-cli",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "cloudcc-cli",
|
|
5
5
|
"author": "cloudcc",
|
|
6
6
|
"license": "ISC",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"bin": {
|
|
13
13
|
"cloudccCreate": "bin/project.js",
|
|
14
14
|
"cloudccBuild": "bin/plugin.js",
|
|
15
|
-
"cc": "bin/cc.js"
|
|
15
|
+
"cc": "bin/cc.js",
|
|
16
|
+
"cloudcc": "bin/cc.js",
|
|
17
|
+
"cc-mcp": "bin/mcp.js"
|
|
16
18
|
},
|
|
17
19
|
"scripts": {
|
|
18
20
|
"test-cli-one": "node --test test/globalSelectList.cli.test.js",
|
|
@@ -10,7 +10,7 @@ const chalk = require('chalk')
|
|
|
10
10
|
*/
|
|
11
11
|
async function create(argvs) {
|
|
12
12
|
try {
|
|
13
|
-
// 命令行参数格式:
|
|
13
|
+
// 命令行参数格式:cloudcc create application <path> <p1> <p2> [duel1]
|
|
14
14
|
// argvs: ['application', 'create', path, p1, p2, duel1]
|
|
15
15
|
let path = argvs[2];
|
|
16
16
|
let p1 = argvs[3]; // 应用名称
|
|
@@ -21,7 +21,7 @@ async function create(argvs) {
|
|
|
21
21
|
if (!p1 || !p2) {
|
|
22
22
|
console.error();
|
|
23
23
|
console.error(chalk.red('Error: 缺少必需参数'));
|
|
24
|
-
console.error('用法:
|
|
24
|
+
console.error('用法: cloudcc create application <path> <p1> <p2> [duel1]');
|
|
25
25
|
console.error(' path: 项目路径');
|
|
26
26
|
console.error(' p1: 应用名称');
|
|
27
27
|
console.error(' p2: 应用代码');
|
|
@@ -4,7 +4,7 @@ const { getPackageJson } = require("../../utils/config");
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 删除应用(Application)
|
|
7
|
-
* 用法:
|
|
7
|
+
* 用法:cloudcc delete application <projectPath> <appId>
|
|
8
8
|
*/
|
|
9
9
|
async function remove(argvs) {
|
|
10
10
|
try {
|
|
@@ -14,7 +14,7 @@ async function remove(argvs) {
|
|
|
14
14
|
if (!appId) {
|
|
15
15
|
console.error();
|
|
16
16
|
console.error(chalk.red("Error: 缺少应用 ID"));
|
|
17
|
-
console.error(chalk.yellow("用法:
|
|
17
|
+
console.error(chalk.yellow("用法: cloudcc delete application <projectPath> <appId>"));
|
|
18
18
|
console.error();
|
|
19
19
|
throw new Error("缺少必需参数: appId");
|
|
20
20
|
}
|
package/src/application/doc.js
CHANGED
|
@@ -21,14 +21,14 @@ function getDevGuideDoc() {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* cloudcc doc application <introduction|devguide>
|
|
25
25
|
* @param {string[]} argvs [doc, type, introduction|devguide, ...]
|
|
26
26
|
*/
|
|
27
27
|
function doc(argvs) {
|
|
28
28
|
const subType = argvs[2];
|
|
29
29
|
const key = String(subType || "").trim().toLowerCase();
|
|
30
30
|
if (!key) {
|
|
31
|
-
throw new Error("
|
|
31
|
+
throw new Error("cloudcc doc application 需要子命令:introduction 或 devguide");
|
|
32
32
|
}
|
|
33
33
|
if (key === "introduction") {
|
|
34
34
|
const content = getIntroductionDoc();
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
`application` 模块用于通过 CLI 管理 CloudCC 应用,当前提供:
|
|
6
6
|
|
|
7
|
-
- 创建应用:`
|
|
8
|
-
- 查询应用:`
|
|
9
|
-
- 删除应用:`
|
|
10
|
-
- 文档查看:`
|
|
7
|
+
- 创建应用:`cloudcc create application ...`
|
|
8
|
+
- 查询应用:`cloudcc get application ...`
|
|
9
|
+
- 删除应用:`cloudcc delete application ...`
|
|
10
|
+
- 文档查看:`cloudcc doc application introduction|devguide`
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
执行命令前请确认:
|
|
17
17
|
|
|
18
|
-
- 已完成 `
|
|
18
|
+
- 已完成 `cloudcc doc project devguide` 的环境初始化
|
|
19
19
|
- 项目根目录存在可用配置,且包含 `accessToken`
|
|
20
20
|
- 已准备应用名称、应用代码
|
|
21
21
|
- 若需自定义菜单挂载,已准备菜单 ID 列表
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
## 3. 命令总览(以代码实现为准)
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
cloudcc create application <path> <p1> <p2> [duel1]
|
|
29
|
+
cloudcc get application <projectPath> [encodedCondJson]
|
|
30
|
+
cloudcc delete application <projectPath> <appId>
|
|
31
|
+
cloudcc doc application <introduction|devguide>
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
参数约定:
|
|
@@ -45,7 +45,7 @@ cc doc application <introduction|devguide>
|
|
|
45
45
|
## 4. 创建应用
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
|
|
48
|
+
cloudcc create application <path> <p1> <p2> [duel1]
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### 4.1 参数说明
|
|
@@ -65,10 +65,10 @@ cc create application <path> <p1> <p2> [duel1]
|
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
# 使用默认菜单 ID
|
|
68
|
-
|
|
68
|
+
cloudcc create application . "销售工作台" sales_workbench
|
|
69
69
|
|
|
70
70
|
# 指定菜单 ID(可多个)
|
|
71
|
-
|
|
71
|
+
cloudcc create application . "销售工作台" sales_workbench "acf000001,a0I9D000000XXXXUAI"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### 4.4 常见报错
|
|
@@ -77,7 +77,7 @@ cc create application . "销售工作台" sales_workbench "acf000001,a0I9D000000
|
|
|
77
77
|
|
|
78
78
|
```text
|
|
79
79
|
Error: 缺少必需参数
|
|
80
|
-
用法:
|
|
80
|
+
用法: cloudcc create application <path> <p1> <p2> [duel1]
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
- 角色列表获取失败(依赖 `brief/get`):
|
|
@@ -91,7 +91,7 @@ Error: 缺少必需参数
|
|
|
91
91
|
## 5. 查询应用
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
|
|
94
|
+
cloudcc get application <projectPath> [encodedCondJson]
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
说明:
|
|
@@ -103,10 +103,10 @@ cc get application <projectPath> [encodedCondJson]
|
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
105
|
# 查询全部应用
|
|
106
|
-
|
|
106
|
+
cloudcc get application .
|
|
107
107
|
|
|
108
108
|
# 按条件查询(示例)
|
|
109
|
-
|
|
109
|
+
cloudcc get application . '%7B%22appType%22%3A%22app%22%7D'
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
若条件 JSON 无法解析,会报错:
|
|
@@ -120,7 +120,7 @@ Get Application List Failed: encodedCondJson 解析失败,请传 encodeURI(JSO
|
|
|
120
120
|
## 6. 删除应用
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
|
-
|
|
123
|
+
cloudcc delete application <projectPath> <appId>
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
参数说明:
|
|
@@ -131,14 +131,14 @@ cc delete application <projectPath> <appId>
|
|
|
131
131
|
示例:
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
|
|
134
|
+
cloudcc delete application . a0L9D000000XXXXUAI
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
缺少 `appId` 时会报错:
|
|
138
138
|
|
|
139
139
|
```text
|
|
140
140
|
Error: 缺少应用 ID
|
|
141
|
-
用法:
|
|
141
|
+
用法: cloudcc delete application <projectPath> <appId>
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
---
|
|
@@ -146,8 +146,8 @@ Error: 缺少应用 ID
|
|
|
146
146
|
## 7. 文档命令
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
cloudcc doc application introduction
|
|
150
|
+
cloudcc doc application devguide
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
仅支持 `introduction` 与 `devguide`,其他子命令会抛错。
|
|
@@ -158,16 +158,16 @@ cc doc application devguide
|
|
|
158
158
|
|
|
159
159
|
```bash
|
|
160
160
|
# 1) 先查现有应用,避免重名
|
|
161
|
-
|
|
161
|
+
cloudcc get application .
|
|
162
162
|
|
|
163
163
|
# 2) 创建应用
|
|
164
|
-
|
|
164
|
+
cloudcc create application . "销售工作台" sales_workbench
|
|
165
165
|
|
|
166
166
|
# 3) 再次查询确认已创建
|
|
167
|
-
|
|
167
|
+
cloudcc get application .
|
|
168
168
|
|
|
169
169
|
# 4) 如需回滚,按 appId 删除
|
|
170
|
-
|
|
170
|
+
cloudcc delete application . <appId>
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
---
|
package/src/button/create.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 自定义按钮 - 新建
|
|
3
3
|
* API: POST {setupSvc}/api/buttonlink/saveButton
|
|
4
|
-
* CLI:
|
|
4
|
+
* CLI: cloudcc create button <projectPath> <objid> <label> [name] [btnType] [event]
|
|
5
5
|
*
|
|
6
6
|
* 参数说明:
|
|
7
7
|
* - projectPath : 项目根目录
|
package/src/button/delete.js
CHANGED
package/src/button/doc.js
CHANGED
|
@@ -11,14 +11,14 @@ function readDocFile(basename) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* cloudcc doc button <introduction|devguide>
|
|
15
15
|
* @param {string[]} argvs [doc, type, introduction|devguide, ...]
|
|
16
16
|
*/
|
|
17
17
|
function doc(argvs) {
|
|
18
18
|
const subType = argvs[2];
|
|
19
19
|
const key = String(subType || "").trim().toLowerCase();
|
|
20
20
|
if (!key) {
|
|
21
|
-
throw new Error("
|
|
21
|
+
throw new Error("cloudcc doc button 需要子命令:introduction 或 devguide");
|
|
22
22
|
}
|
|
23
23
|
if (key === "introduction") {
|
|
24
24
|
const content = readDocFile("introduction");
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
## 2. 查询按钮列表
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
20
|
+
cloudcc get button . <prefix>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
- `<prefix>`:对象的 prefix,可从对象管理页或对象 API 名称前缀获取(如 `a75`)
|
|
@@ -60,7 +60,7 @@ cc get button . <prefix>
|
|
|
60
60
|
## 3. 新建自定义按钮
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
|
|
63
|
+
cloudcc create button . <objid> <label> [name] [btnType] [event]
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
| 参数 | 必填 | 说明 |
|
|
@@ -84,19 +84,19 @@ cc create button . <objid> <label> [name] [btnType] [event]
|
|
|
84
84
|
|
|
85
85
|
```bash
|
|
86
86
|
# 新建 template 类型按钮(默认)
|
|
87
|
-
|
|
87
|
+
cloudcc create button . 202646FC67ACF24D39sG "我的按钮"
|
|
88
88
|
|
|
89
89
|
# 指定名称和显示类型
|
|
90
|
-
|
|
90
|
+
cloudcc create button . 202646FC67ACF24D39sG "我的按钮" myBtn detailBtn
|
|
91
91
|
|
|
92
92
|
# lightning-script 类型,列表按钮
|
|
93
|
-
|
|
93
|
+
cloudcc create button . 202646FC67ACF24D39sG "脚本按钮" scriptBtn listBtn lightning-script
|
|
94
94
|
|
|
95
95
|
# lightning-url 类型(移动端自动取第一个自定义页面组件)
|
|
96
|
-
|
|
96
|
+
cloudcc create button . 202646FC67ACF24D39sG "跳转按钮" urlBtn detailBtn lightning-url
|
|
97
97
|
|
|
98
98
|
# url 类型
|
|
99
|
-
|
|
99
|
+
cloudcc create button . 202646FC67ACF24D39sG "外链按钮" linkBtn detailBtn url
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
> **注意:** 各类型代码/URL 默认值仅供快速创建使用,创建后请在页面上编辑替换为实际内容。
|
|
@@ -106,7 +106,7 @@ cc create button . 202646FC67ACF24D39sG "外链按钮" linkBtn detailBtn url
|
|
|
106
106
|
## 4. 删除自定义按钮
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
|
-
|
|
109
|
+
cloudcc delete button . <id>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
| 参数 | 必填 | 说明 |
|
|
@@ -118,7 +118,7 @@ cc delete button . <id>
|
|
|
118
118
|
### 示例
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
|
|
121
|
+
cloudcc delete button . adc202642BBED6BFlu6D
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
---
|
|
@@ -126,8 +126,8 @@ cc delete button . adc202642BBED6BFlu6D
|
|
|
126
126
|
## 5. 查看文档
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
cloudcc doc button introduction # 能力与适用场景说明
|
|
130
|
+
cloudcc doc button devguide # 本操作指南
|
|
131
131
|
```
|
|
132
132
|
|
|
133
133
|
---
|
package/src/button/get.js
CHANGED
package/src/button/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function Button(action, argvs) {
|
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
if (action === "create") {
|
|
13
|
-
//
|
|
13
|
+
// cloudcc create button <projectPath> <objid> <label> [name] [btnType] [event]
|
|
14
14
|
cc.create(argvs[2], argvs[3], argvs[4], argvs[5], argvs[6], argvs[7]);
|
|
15
15
|
return;
|
|
16
16
|
}
|
package/src/classes/create.js
CHANGED
package/src/classes/delete.js
CHANGED
|
@@ -5,7 +5,7 @@ const { getPackageJson } = require("../../utils/config");
|
|
|
5
5
|
const { postClass } = require("../../utils/http");
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* cloudcc delete classes <nameOrId> [projectPath]
|
|
9
9
|
* @param {string[]} argvs [action, type, nameOrId, projectPath?]
|
|
10
10
|
*/
|
|
11
11
|
async function remove(argvs) {
|