cloudcc-cli 2.3.9 → 2.4.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 (53) hide show
  1. package/README.md +48 -0
  2. package/bin/cc.js +2 -1
  3. package/bin/index.js +1 -0
  4. package/cloudcc-dev-skill/SKILL.md +31 -8
  5. package/cloudcc-dev-skill/cloudcc-dev-html.md +42 -0
  6. package/cloudcc-dev-skill/config.json +2 -2
  7. package/mcp/index.js +10 -4
  8. package/mcp/tools/JSP Migrator/handler.js +51 -866
  9. package/mcp/tools/Object Creator/handler.js +14 -4
  10. package/mcp/tools/Trigger List Retriever/handler.js +24 -8
  11. package/package.json +1 -1
  12. package/src/classes/docs/devguide.md +863 -356
  13. package/src/classes/docs/introduction.md +279 -143
  14. package/src/jsp/analyze.js +17 -0
  15. package/src/jsp/doc.js +18 -0
  16. package/src/jsp/docs/devguide.md +111 -0
  17. package/src/jsp/docs/introduction.md +50 -0
  18. package/src/jsp/docs.js +21 -0
  19. package/src/jsp/index.js +14 -0
  20. package/src/jsp/migration.js +871 -0
  21. package/src/jsp/split.js +17 -0
  22. package/src/object/create.js +36 -10
  23. package/src/object/docs/devguide.md +6 -3
  24. package/src/project/docs/devguide.md +1 -1
  25. package/src/script/docs/devguide.md +22 -2
  26. package/src/timer/docs/devguide.md +1038 -400
  27. package/src/timer/docs/introduction.md +343 -231
  28. package/src/triggers/docs/devguide.md +1027 -329
  29. package/src/triggers/docs/introduction.md +640 -369
  30. package/src/triggers/get.js +8 -0
  31. package/src/version/listModuleCommands.js +6 -0
  32. package/target/classes/com/cloudcc/core/BaseException.class +0 -0
  33. package/target/classes/com/cloudcc/core/BusiException.class +0 -0
  34. package/target/classes/com/cloudcc/core/CCObject.class +0 -0
  35. package/target/classes/com/cloudcc/core/CCSchedule.class +0 -0
  36. package/target/classes/com/cloudcc/core/CCService.class +0 -0
  37. package/target/classes/com/cloudcc/core/CCTrigger.class +0 -0
  38. package/target/classes/com/cloudcc/core/CCTriggerHandler.class +0 -0
  39. package/target/classes/com/cloudcc/core/DevLogger.class +0 -0
  40. package/target/classes/com/cloudcc/core/OperatationEnum.class +0 -0
  41. package/target/classes/com/cloudcc/core/PeakInterf.class +0 -0
  42. package/target/classes/com/cloudcc/core/SendEmail.class +0 -0
  43. package/target/classes/com/cloudcc/core/ServiceResult.class +0 -0
  44. package/target/classes/com/cloudcc/core/StringUtils.class +0 -0
  45. package/target/classes/com/cloudcc/core/TimeUtil.class +0 -0
  46. package/target/classes/com/cloudcc/core/Tool$1.class +0 -0
  47. package/target/classes/com/cloudcc/core/Tool.class +0 -0
  48. package/target/classes/com/cloudcc/core/TriggerInvoker.class +0 -0
  49. package/target/classes/com/cloudcc/core/TriggerMethod.class +0 -0
  50. package/target/classes/com/cloudcc/core/TriggerTimeEnum.class +0 -0
  51. package/target/classes/com/cloudcc/core/UserInfo.class +0 -0
  52. package/test/jsp.cli.test.js +70 -0
  53. package/test/object.cli.test.js +9 -1
@@ -0,0 +1,17 @@
1
+ const { splitJspToCloudcc, parseCliJsonArg } = require("./migration")
2
+
3
+ async function split(argvs) {
4
+ const params = parseCliJsonArg(
5
+ argvs[2],
6
+ "cloudcc split jsp <encodeURI(JSON.stringify(params))>"
7
+ )
8
+ const result = await splitJspToCloudcc(params)
9
+ if (!result.success) {
10
+ throw new Error(result.text)
11
+ }
12
+
13
+ console.log(result.text)
14
+ return result.text
15
+ }
16
+
17
+ module.exports = split
@@ -5,32 +5,58 @@ const { labelToSlug } = require("../../utils/utils");
5
5
  const chalk = require('chalk')
6
6
 
7
7
  /**
8
- * label 转换为英文可用的 slug,用于生成 schemetableName
9
- * 优先尝试使用 pinyin 包(如果安装),否则使用宽松的 ASCII slug 方案
8
+ * 未显式传入备注时,根据对象标签生成默认业务功能说明(写入接口 remark)
9
+ * @param {string} label
10
10
  */
11
- // labelToSlug now lives in utils/utils.js
12
-
11
+ function defaultObjectRemark(label) {
12
+ return `用于管理与「${label}」相关的业务数据`;
13
+ }
13
14
 
14
15
  /**
15
- * 保存自定义对象按钮配置
16
+ * 创建自定义对象(接口 obj.remark:默认业务说明 + 必填业务功能描述,拼在后面)
16
17
  * @param {Array} argvs - 命令行参数数组
17
18
  * @returns {Promise<Object>} 保存结果
18
19
  */
19
20
  async function create(argvs) {
20
21
  try {
21
22
  let path = argvs[2];
22
- // 兼容两种调用方式:
23
- // 1) cloudcc object create <path> <nameLabel> <label>
24
- // 2) cloudcc object create <path> <label> (此时自动生成 nameLabel)
25
23
  let label = argvs[3];
26
24
  let nameLabel = argvs[4];
25
+ let remarkSuffix = argvs[5];
26
+
27
+ if (remarkSuffix == null) {
28
+ remarkSuffix = nameLabel;
29
+ nameLabel = undefined;
30
+ }
31
+
32
+ if (remarkSuffix == null || String(remarkSuffix).trim() === "") {
33
+ console.error();
34
+ console.error(chalk.red("Error: 缺少必需参数「业务功能描述」"));
35
+ console.error(
36
+ chalk.gray(
37
+ "用法: cloudcc create object <path> <label> <业务功能描述>"
38
+ )
39
+ );
40
+ console.error(
41
+ chalk.gray(
42
+ " cloudcc create object <path> <label> <nameLabel> <业务功能描述>"
43
+ )
44
+ );
45
+ console.error();
46
+ throw new Error("缺少业务功能描述");
47
+ }
48
+
27
49
  if (nameLabel == undefined) {
28
50
  const slug = labelToSlug(label);
29
51
  nameLabel = `${slug}_custom_object`;
30
52
  }
53
+
54
+ const base = defaultObjectRemark(label);
55
+ const remark = `${base} ${String(remarkSuffix).trim()}`;
56
+
31
57
  let config = await getPackageJson(path);
32
58
 
33
- // 从 brief/get 获取角色ID列表(仍使用原始 argv 参数: path 位于 argvs[2])
59
+ // 从 brief/get 获取角色ID列表(path 位于 argvs[2])
34
60
  // 注意:brief/get 的接口返回是 { success, data } 的格式
35
61
  let briefData = await briefGet(argvs);
36
62
 
@@ -68,7 +94,7 @@ async function create(argvs) {
68
94
  isquickcreated: "false",
69
95
  islbs: "false",
70
96
  isreportcreated: "false",
71
- remark: "auto created by cloudcc-cli ai agent"
97
+ remark
72
98
  }
73
99
  };
74
100
 
@@ -17,7 +17,8 @@ cloudcc doc object devguide
17
17
 
18
18
  ```bash
19
19
  cloudcc get object <projectPath> [type]
20
- cloudcc create object <projectPath> <label> [nameLabel]
20
+ cloudcc create object <projectPath> <label> <业务功能描述>
21
+ cloudcc create object <projectPath> <label> <nameLabel> <业务功能描述>
21
22
  cloudcc delete object <projectPath> <objid>
22
23
  ```
23
24
 
@@ -25,7 +26,8 @@ cloudcc delete object <projectPath> <objid>
25
26
 
26
27
  - `projectPath`:本地项目路径,用于读取 `cloudcc-cli.config.js`
27
28
  - `label`:对象中文名称或展示名称
28
- - `nameLabel`:对象 API 名称;不传时会基于 `label` 自动生成
29
+ - `nameLabel`:对象 API 名称;仅在上一种四参数形式中传入;不传(三参数形式)时基于 `label` 自动生成
30
+ - `业务功能描述`(**必填**,放在最后):拼接到默认 remark「用于管理与「label」相关的业务数据」之后,整体写入 `obj.remark`
29
31
  - `objid`:对象 ID
30
32
 
31
33
  ---
@@ -59,7 +61,8 @@ cloudcc get object <projectPath> custom
59
61
  ### 4.1 基本命令
60
62
 
61
63
  ```bash
62
- cloudcc create object <projectPath> <label>
64
+ cloudcc create object <projectPath> <label> "记录客户拜访与跟进计划"
65
+ cloudcc create object <projectPath> <label> <nameLabel> "主数据:客户主档"
63
66
  ```
64
67
 
65
68
 
@@ -155,7 +155,7 @@ cd ~/Documents
155
155
  cloudcc create project demo1
156
156
  ```
157
157
 
158
- `demo1` 为示例项目名,可按需替换。
158
+ `demo1` 为示例项目名,可按需替换,写入.表示在当前目录创建
159
159
 
160
160
  ### 6.2 安装依赖并启动
161
161
 
@@ -55,9 +55,12 @@ cloudcc get script <encodedCondJson> <projectPath>
55
55
  | condition | object | 非必须 | `{}` | 查询条件 |
56
56
  | condition.scriptName | string | 非必须 | `""` | 脚本名称筛选 |
57
57
  | condition.pageLabel | string | 非必须 | `""` | 页面标签筛选 |
58
- | condition.objName | string | 非必须 | `""` | 对象名称筛选 |
58
+ | condition.objName | string | 非必须 | `""` | 对象名称label筛选(例如你说“客户对象”,就传 `客户`;不要让 AI 自动映射成 `account`) |
59
59
 
60
- 输出:简化列表(每条包含 `name` / `id` / `apiname`)。
60
+
61
+ > 注意:`objName` 直接按你要查询的对象名称来传,并按实际值原样传入。
62
+ > 例如对象名称是 `客户`、`客户004`,就直接传 `客户`、`客户004`;**不要**按语义自动换成 `account`。
63
+ > 如果返回为空,通常意味着目标环境里的对象名称不是你传的这个值(可以去对象管理里看一下该对象的名称/标识)。
61
64
 
62
65
  ---
63
66
 
@@ -177,6 +180,23 @@ cloudcc get script "$(node -e "console.log(encodeURI(JSON.stringify({pageSize:50
177
180
  cloudcc get script "$(node -e "console.log(encodeURI(JSON.stringify({pageSize:50,pageNo:1,condition:{scriptName:'test',pageLabel:'',objName:''}})))")" .
178
181
  ```
179
182
 
183
+ ### 按对象名称筛选(示例:`客户` / `客户004`)
184
+
185
+ ```bash
186
+ # 对象名称为“客户”
187
+ cloudcc get script "$(node -e "console.log(encodeURI(JSON.stringify({pageSize:50,pageNo:1,condition:{scriptName:'',pageLabel:'',objName:'客户'}})))")" .
188
+
189
+ # 对象名称为“客户004”
190
+ cloudcc get script "$(node -e "console.log(encodeURI(JSON.stringify({pageSize:50,pageNo:1,condition:{scriptName:'',pageLabel:'',objName:'客户004'}})))")" .
191
+ ```
192
+
193
+ 错误示例(不要这样传):
194
+
195
+ ```bash
196
+ # 业务上说“客户”,就不要自作主张写成 account
197
+ cloudcc get script "$(node -e "console.log(encodeURI(JSON.stringify({pageSize:50,pageNo:1,condition:{scriptName:'',pageLabel:'',objName:'account'}})))")" .
198
+ ```
199
+
180
200
  ### 新建脚本(本地)
181
201
 
182
202
  ```bash