cloudcc-cli 2.2.6 → 2.2.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.
Files changed (117) hide show
  1. package/.cloudcc-cache.json +24 -20
  2. package/README.md +12 -0
  3. package/bin/cc.js +7 -0
  4. package/java/com/cloudcc/core/BaseException.java +100 -0
  5. package/java/com/cloudcc/core/BusiException.java +43 -0
  6. package/java/com/cloudcc/core/CCService.java +3 -1
  7. package/java/com/cloudcc/core/StringUtils.java +7 -0
  8. package/java/com/cloudcc/core/TimeUtil.java +33 -0
  9. package/java/com/cloudcc/core/UserInfo.java +9 -0
  10. package/package.json +7 -1
  11. package/pom.xml +1 -1
  12. package/skill/BACKEND_CODE.md +114 -0
  13. package/skill/CLI_CHEATSHEET.md +90 -0
  14. package/skill/INSTALL_AND_BOOTSTRAP.md +59 -0
  15. package/skill/OBJECTS_AND_FIELDS.md +120 -0
  16. package/skill/REQUIREMENTS_BREAKDOWN.md +98 -0
  17. package/skill/SKILL.md +33 -0
  18. package/skill/VUE_CUSTOM_COMPONENT.md +50 -0
  19. package/src/api/backend-sdk-java.md +427 -0
  20. package/src/api/ccdk-sdk.md +1039 -0
  21. package/src/classes/doc.js +486 -0
  22. package/src/classes/index.js +1 -0
  23. package/src/mcp/cliRunner.js +61 -0
  24. package/src/mcp/index.js +41 -3
  25. package/src/mcp/tools/Application Creator/handler.js +7 -9
  26. package/src/mcp/tools/Approval/handler.js +34 -151
  27. package/src/mcp/tools/Class Creator/handler.js +18 -15
  28. package/src/mcp/tools/Class Detail Retriever/handler.js +8 -9
  29. package/src/mcp/tools/Class Editor Guide/handler.js +5 -19
  30. package/src/mcp/tools/Class List Retriever/handler.js +8 -3
  31. package/src/mcp/tools/Class Publisher/handler.js +7 -9
  32. package/src/mcp/tools/Class Puller/handler.js +6 -65
  33. package/src/mcp/tools/Client Script Detail Retriever/handler.js +12 -18
  34. package/src/mcp/tools/Client Script Editor Guide/handler.js +9 -605
  35. package/src/mcp/tools/Client Script List Retriever/handler.js +30 -33
  36. package/src/mcp/tools/Client Script Publisher/handler.js +12 -11
  37. package/src/mcp/tools/Client Script Puller/handler.js +23 -30
  38. package/src/mcp/tools/CloudCC Development Overview/handler.js +11 -5
  39. package/src/mcp/tools/Component Creator/handler.js +12 -11
  40. package/src/mcp/tools/Component Detail Retriever/handler.js +12 -9
  41. package/src/mcp/tools/Component Editor Guide/handler.js +5 -22
  42. package/src/mcp/tools/Component List Retriever/handler.js +21 -18
  43. package/src/mcp/tools/Component Publisher/handler.js +25 -3
  44. package/src/mcp/tools/Component Puller/handler.js +13 -16
  45. package/src/mcp/tools/Dev Environment Creator/handler.js +5 -72
  46. package/src/mcp/tools/Dev Environment Validator/handler.js +5 -66
  47. package/src/mcp/tools/Developer Key Setup Guide/handler.js +11 -20
  48. package/src/mcp/tools/JSP Migrator/handler.js +842 -0
  49. package/src/mcp/tools/Menu Creator/handler.js +7 -30
  50. package/src/mcp/tools/Object Creator/handler.js +14 -6
  51. package/src/mcp/tools/Object Fields Creator/handler.js +9 -10
  52. package/src/mcp/tools/Object Fields Retriever/handler.js +6 -3
  53. package/src/mcp/tools/Object List Retriever/handler.js +10 -7
  54. package/src/mcp/tools/Scheduled Class Creator/handler.js +12 -16
  55. package/src/mcp/tools/Scheduled Class Detail Retriever/handler.js +7 -9
  56. package/src/mcp/tools/Scheduled Class List Retriever/handler.js +21 -23
  57. package/src/mcp/tools/Scheduled Class Publisher/handler.js +7 -9
  58. package/src/mcp/tools/Scheduled Class Puller/handler.js +6 -70
  59. package/src/mcp/tools/Trigger Creator/handler.js +12 -20
  60. package/src/mcp/tools/Trigger Detail Retriever/handler.js +7 -9
  61. package/src/mcp/tools/Trigger Editor Guide/handler.js +10 -35
  62. package/src/mcp/tools/Trigger List Retriever/handler.js +12 -4
  63. package/src/mcp/tools/Trigger Publisher/handler.js +8 -11
  64. package/src/mcp/tools/Trigger Puller/handler.js +12 -17
  65. package/src/plugin/doc.js +801 -0
  66. package/src/plugin/index.js +1 -0
  67. package/src/project/doc.js +378 -0
  68. package/src/project/index.js +1 -0
  69. package/src/script/doc.js +259 -0
  70. package/src/script/index.js +1 -0
  71. package/src/timer/index.js +1 -0
  72. package/src/triggers/doc.js +342 -0
  73. package/src/triggers/index.js +5 -0
  74. package/target/classes/com/cloudcc/core/BaseException.class +0 -0
  75. package/target/classes/com/cloudcc/core/BusiException.class +0 -0
  76. package/target/classes/com/cloudcc/core/CCService.class +0 -0
  77. package/target/classes/com/cloudcc/core/StringUtils.class +0 -0
  78. package/target/classes/com/cloudcc/core/TimeUtil.class +0 -0
  79. package/target/classes/com/cloudcc/core/UserInfo.class +0 -0
  80. package/template/lib/ccopenapi-0.0.4.jar +0 -0
  81. package/test/application.cli.test.js +30 -0
  82. package/test/classes.cli.test.js +121 -0
  83. package/test/fields.cli.test.js +69 -0
  84. package/test/mcp.cli.test.js +21 -0
  85. package/test/menu.cli.test.js +41 -0
  86. package/test/object.cli.test.js +64 -0
  87. package/test/plugin.cli.test.js +109 -0
  88. package/test/script.cli.test.js +101 -0
  89. package/test/timer.cli.test.js +107 -0
  90. package/test/trigger.cli.test.js +146 -0
  91. package/.vscode/settings.json +0 -3
  92. package/bin/mcp-svc.js +0 -13
  93. package/src/mcp/MCP/345/234/272/346/231/257/346/250/241/346/213/237.md +0 -8
  94. package/src/mcp/index-sse-svc.js +0 -126
  95. package/src/mcp/index-streamable-svc.js +0 -180
  96. package/src/mcp/tools/Class Detail Retriever/prompt.js +0 -37
  97. package/src/mcp/tools/Class Editor Guide/prompt.js +0 -468
  98. package/src/mcp/tools/Class Publisher/prompt.js +0 -40
  99. package/src/mcp/tools/Class Puller/prompt.js +0 -49
  100. package/src/mcp/tools/Client Script Creator/handler.js +0 -179
  101. package/src/mcp/tools/CloudCC Development Overview/prompt.js +0 -871
  102. package/src/mcp/tools/Component Editor Guide/prompt.js +0 -519
  103. package/src/mcp/tools/Component Publisher/prompt.js +0 -659
  104. package/src/mcp/tools/Dev Environment Creator/prompt.js +0 -273
  105. package/src/mcp/tools/Dev Environment Validator/prompt.js +0 -193
  106. package/src/mcp/tools/Developer Key Setup Guide/prompt.js +0 -71
  107. package/src/mcp/tools/Object Fields Retriever/prompt.js +0 -10
  108. package/src/mcp/tools/Object List Retriever/prompt.js +0 -10
  109. package/src/mcp/tools/ccdk/fetcher.js +0 -18
  110. package/src/mcp/tools/ccdk/handler.js +0 -98
  111. package/src/mcp/tools/ccdk/prompt.js +0 -453
  112. package/target/ccopenapi-0.0.3-classes.jar +0 -0
  113. package/target/ccopenapi-0.0.3.jar +0 -0
  114. package/target/maven-archiver/pom.properties +0 -3
  115. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +0 -18
  116. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -19
  117. package/template/lib/ccopenapi-0.0.3.jar +0 -0
@@ -1,34 +1,38 @@
1
1
  {
2
+ "version_check": {
3
+ "timestamp": 1773815782543
4
+ },
5
+ "Je6yZ0TRyQFtpcH1gVKctqNhL": {
6
+ "username": "admin@testuat.com",
7
+ "baseUrl": "https://uat-one.cloudcc.cn/ccdomaingateway",
8
+ "orgId": "org28e02f50c6d727bbc",
9
+ "clientId": "MkZxyFscNEjHjQfR6lK4ZG8Ac",
10
+ "version": "public",
11
+ "openSecretKey": "ae62146f-e8d8-4cba-a60c-0d1e0cb80375",
12
+ "safetyMark": "Je6yZ0TRyQFtpcH1gVKctqNhL",
13
+ "CloudCCDev": "",
14
+ "apiSvc": "https://uat-one.cloudcc.cn/ccdomaingateway/apisvc",
15
+ "setupSvc": "https://uat-one.cloudcc.cn/ccdomaingateway/setup",
16
+ "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjbG91ZGNjIiwibG9naW5OYW1lIjoiYWRtaW5AdGVzdHVhdC5jb20iLCJiaW5kaW5nIjoiYzQ2MTFjMmYtZGYyNS00NTQ5LTkxZTktZDkzY2YyMGFjOWIzIiwiQ2xpZW50SWQiOiJNa1p4eUZzY05FakhqUWZSNmxLNFpHOEFjIiwiZXhwIjoxNzczODk5MzM1LCJvcmdJZCI6Im9yZzI4ZTAyZjUwYzZkNzI3YmJjIn0._cpwUjyBbaHYGphZ5pGAksySYeG_ErHx8mEc3r03mns",
17
+ "secretKey": "40e68c50d21f41a1a583d7a7d55da3",
18
+ "pluginToken": "unified20269eec2d32c",
19
+ "timestamp": 1773812935285
20
+ },
2
21
  "QVOllKTKhnm5oHp49tCsSHvHg": {
3
22
  "username": "appstore@cloudcc.cn",
4
23
  "baseUrl": "https://yundong.lightning.cloudcc.cn/ccdomaingateway",
24
+ "setupSvc": "https://yundong.lightning.cloudcc.cn/ccdomaingateway/setup",
5
25
  "orgId": "org9697882320dc71f28",
6
26
  "clientId": "bIA1IXRHl28hBkaQdiwQ63hZZ",
7
27
  "version": "public",
8
28
  "openSecretKey": "15bba2de-e6e7-42dc-9d7c-f9b157cd0ddb",
9
29
  "CloudCCDev": "",
10
30
  "safetyMark": "QVOllKTKhnm5oHp49tCsSHvHg",
31
+ "buildVersion": "v2",
11
32
  "apiSvc": "https://yundong.lightning.cloudcc.cn/ccdomaingateway/apisvc",
12
- "setupSvc": "https://yundong.lightning.cloudcc.cn/ccdomaingateway/setup",
13
- "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjbG91ZGNjIiwibG9naW5OYW1lIjoiYXBwc3RvcmVAY2xvdWRjYy5jbiIsImJpbmRpbmciOiJkYTY1NWYwOS02NmVmLTQ0NTktOTU5Ny05MmI3YWI1MTkzNTciLCJDbGllbnRJZCI6ImJJQTFJWFJIbDI4aEJrYVFkaXdRNjNoWloiLCJleHAiOjE3Njk3NjQ5NzYsIm9yZ0lkIjoib3JnOTY5Nzg4MjMyMGRjNzFmMjgifQ.Md2bT3oZKT-WHMLmEBdKw-sA9Hh2FC61qKTZffXHOJc",
33
+ "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjbG91ZGNjIiwibG9naW5OYW1lIjoiYXBwc3RvcmVAY2xvdWRjYy5jbiIsImJpbmRpbmciOiJjYjhhZTY5MS0yNjJhLTRiMmEtOTVmNS05ODY3ZGIxYTNlYTEiLCJDbGllbnRJZCI6ImJJQTFJWFJIbDI4aEJrYVFkaXdRNjNoWloiLCJleHAiOjE3NzM5OTA4NzksIm9yZ0lkIjoib3JnOTY5Nzg4MjMyMGRjNzFmMjgifQ.lbROZu-5HCTHgOlqrWqWbR_oVIV7uTjh8sqiPGGkmis",
14
34
  "secretKey": "d99313b4298544bc8ca1ee7459227b",
15
- "pluginToken": "unified202648c3bd21f",
16
- "timestamp": 1769592177005
17
- },
18
- "9lTJpVZ7Gz6Q7Uu8KuO2BT4ED": {
19
- "username": "cloudcc008@126.com",
20
- "baseUrl": "https://cnbh01.cloudcc.cn/ccdomaingateway",
21
- "setupSvc": "https://cnbh01.cloudcc.cn/ccdomaingateway/setup",
22
- "orgId": "orgc481843971a8faa9a",
23
- "clientId": "mruqXvHCsu1Mp6ZiFN30ddocZ",
24
- "version": "public",
25
- "openSecretKey": "88d38e16-3d07-49de-9de4-16bace67eaa6",
26
- "safetyMark": "9lTJpVZ7Gz6Q7Uu8KuO2BT4ED",
27
- "CloudCCDev": "",
28
- "apiSvc": "https://cnbh01.cloudcc.cn/ccdomaingateway/apisvc",
29
- "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjbG91ZGNjIiwibG9naW5OYW1lIjoiY2xvdWRjYzAwOEAxMjYuY29tIiwiYmluZGluZyI6IjMzMDk1MmUxLTY2NTgtNGUzNS04M2ZkLTRkYjRmMTE2NGM0YyIsIkNsaWVudElkIjoibXJ1cVh2SENzdTFNcDZaaUZOMzBkZG9jWiIsImV4cCI6MTc2OTc3MjU0OCwib3JnSWQiOiJvcmdjNDgxODQzOTcxYThmYWE5YSJ9.sdMAQfcYG7zdAokg5eXU0dNbHas7wmK-l2S4YREProo",
30
- "secretKey": "52f3abb9f50a4cc392dbf9549e158d",
31
- "pluginToken": "unified20265de00f22d",
32
- "timestamp": 1769599748664
35
+ "pluginToken": "unified2026546fe51ba",
36
+ "timestamp": 1773818080344
33
37
  }
34
38
  }
package/README.md CHANGED
@@ -22,6 +22,18 @@ sudo npm i -g cloudcc-cli
22
22
  }
23
23
  ```
24
24
 
25
+ # ReleaseV2.2.7
26
+
27
+ #### Release Date: 2026-3-20
28
+
29
+ #### Release Scope: Full
30
+
31
+ #### Release Content
32
+
33
+ - Optimization
34
+ - 规范mcp使用,必须调用cc命令
35
+ - 提供了skill,用于访问cc命令
36
+
25
37
  # ReleaseV2.2.6
26
38
 
27
39
  #### Release Date: 2026-2-25
package/bin/cc.js CHANGED
@@ -27,6 +27,13 @@ if (!type) {
27
27
  }
28
28
  const cc = require("./index")
29
29
  try {
30
+ if (action === "doc") {
31
+ if (!cc[type]) {
32
+ throw new Error(`doc 不支持的类型: ${type}`);
33
+ }
34
+ cc[type]("doc", argvs);
35
+ return;
36
+ }
30
37
  cc[argvs[1]](argvs[0], argvs);
31
38
  } catch (e) {
32
39
  console.error()
@@ -0,0 +1,100 @@
1
+ package com.cloudcc.core;
2
+
3
+ import java.io.PrintStream;
4
+ import java.io.PrintWriter;
5
+ import java.util.ArrayList;
6
+ import java.util.List;
7
+
8
+ public class BaseException extends Exception {
9
+ private static final long serialVersionUID = -960185495264426709L;
10
+ public static final long ERROR_PAGE = 1L;
11
+ public static final long RETURN_PAGE = 2L;
12
+ public static final long RETURN_BYPAGE = 3L;
13
+ private Throwable rootCause = null;
14
+ private List exceptions = new ArrayList();
15
+ private List messageArgs = new ArrayList();
16
+ private String messageKey = null;
17
+ private long displayType = 1L;
18
+ private String returnForward = null;
19
+
20
+ protected BaseException() {
21
+ }
22
+
23
+ protected BaseException(String errmsg) {
24
+ super(errmsg);
25
+ this.messageArgs.add(errmsg);
26
+ }
27
+
28
+ protected BaseException(Throwable cause) {
29
+ super(cause);
30
+ this.rootCause = cause;
31
+ }
32
+
33
+ protected BaseException(String errmsg, Throwable cause) {
34
+ super(errmsg, cause);
35
+ this.messageArgs.add(errmsg);
36
+ this.rootCause = cause;
37
+ }
38
+
39
+ protected BaseException(List args) {
40
+ this.messageArgs = args;
41
+ }
42
+
43
+ protected BaseException(String msgKey, List args) {
44
+ this.messageKey = msgKey;
45
+ this.messageArgs = args;
46
+ }
47
+
48
+ public void printStackTrace(PrintWriter writer) {
49
+ super.printStackTrace(writer);
50
+ if (this.getRootCause() != null) {
51
+ this.getRootCause().printStackTrace(writer);
52
+ }
53
+
54
+ writer.flush();
55
+ }
56
+
57
+ public void printStackTrace(PrintStream outStream) {
58
+ this.printStackTrace(new PrintWriter(outStream));
59
+ }
60
+
61
+ public void printStackTrace() {
62
+ this.printStackTrace(System.err);
63
+ }
64
+
65
+ public Throwable getRootCause() {
66
+ return this.rootCause;
67
+ }
68
+
69
+ public String getMessageKey() {
70
+ return this.messageKey;
71
+ }
72
+
73
+ public List getExceptions() {
74
+ return this.exceptions;
75
+ }
76
+
77
+ public void addException(BaseException ex) {
78
+ this.exceptions.add(ex);
79
+ }
80
+
81
+ public List getMessageArgs() {
82
+ return this.messageArgs;
83
+ }
84
+
85
+ public long getDisplayType() {
86
+ return this.displayType;
87
+ }
88
+
89
+ public void setDisplayType(long displayType) {
90
+ this.displayType = displayType;
91
+ }
92
+
93
+ public String getReturnForward() {
94
+ return this.returnForward;
95
+ }
96
+
97
+ public void setReturnForward(String returnForward) {
98
+ this.returnForward = returnForward;
99
+ }
100
+ }
@@ -0,0 +1,43 @@
1
+ package com.cloudcc.core;
2
+
3
+ import java.util.List;
4
+
5
+ public class BusiException extends BaseException {
6
+ private static final long serialVersionUID = -4060192906349249047L;
7
+
8
+ public BusiException() {
9
+ }
10
+
11
+ public BusiException(String errmsg) {
12
+ super(errmsg);
13
+ }
14
+
15
+ public BusiException(Throwable cause) {
16
+ super(cause);
17
+ }
18
+
19
+ public BusiException(String errmsg, Throwable cause) {
20
+ super(errmsg, cause);
21
+ }
22
+
23
+ public String toString() {
24
+ StringBuffer sb = new StringBuffer();
25
+ List messageArgs = this.getMessageArgs();
26
+
27
+ for(int i = 0; i < messageArgs.size(); ++i) {
28
+ sb.append("\t").append((String)messageArgs.get(i)).append("\n");
29
+ }
30
+
31
+ sb.append("\n\n");
32
+ Throwable t = this.getRootCause();
33
+ if (t != null) {
34
+ StackTraceElement[] ste = t.getStackTrace();
35
+
36
+ for(int i = 0; i < ste.length; ++i) {
37
+ sb.append("\t").append(ste[i]).append("\n");
38
+ }
39
+ }
40
+
41
+ return sb.toString();
42
+ }
43
+ }
@@ -607,5 +607,7 @@ public class CCService {
607
607
  public String process(String processType, String tid, String touserId, String comments, String appPath) {
608
608
  return null;
609
609
  }
610
-
610
+ public ServiceResult update(List<CCObject> ccobjs) throws BusiException {
611
+ return null;
612
+ }
611
613
  }
@@ -0,0 +1,7 @@
1
+ package com.cloudcc.core;
2
+
3
+ public class StringUtils {
4
+ public static boolean isNotNullAndEmpty(Object s){
5
+ return s != null && !s.equals("");
6
+ }
7
+ }
@@ -2,10 +2,43 @@
2
2
  package com.cloudcc.core;
3
3
 
4
4
  import java.text.SimpleDateFormat;
5
+ import java.util.Date;
6
+ import java.util.TimeZone;
5
7
 
6
8
  public class TimeUtil {
9
+ private static final TimeZone DEFAULT_TIMEZONE = TimeZone.getDefault();
10
+ private static final boolean isChinastandardTimeZone=true;
7
11
 
8
12
  public static SimpleDateFormat getSimpleDateFormat(String string, UserInfo userInfo) {
9
13
  return new SimpleDateFormat(string);
10
14
  }
15
+ public static Date getNowDate(UserInfo userInfo) {
16
+ return parseDate(new Date(), userInfo);
17
+ }
18
+ public static Date parseDate(Date date, UserInfo userInfo) {
19
+ TimeZone userTZ = getUserTimeZone(userInfo);
20
+ return parseDate(date, userTZ);
21
+ }
22
+ public static Date parseDate(Date date, TimeZone tz) {
23
+ if (isChinastandardTimeZone) {
24
+ if ((long)tz.getRawOffset() == 28800000L) {
25
+ return date;
26
+ } else {
27
+ long offset = (long)tz.getRawOffset() - 28800000L;
28
+ return new Date(date.getTime() + offset);
29
+ }
30
+ } else {
31
+ long offset = (long)(tz.getRawOffset() - DEFAULT_TIMEZONE.getRawOffset());
32
+ return new Date(date.getTime() + offset);
33
+ }
34
+ }
35
+
36
+ public static TimeZone getUserTimeZone(UserInfo userInfo) {
37
+ if (userInfo != null && StringUtils.isNotNullAndEmpty(userInfo.getTimeZone())) {
38
+ String timeZoneId = userInfo.getTimeZone();
39
+ return !timeZoneId.startsWith("+") && !timeZoneId.startsWith("-") ? TimeZone.getTimeZone(timeZoneId) : TimeZone.getTimeZone("GMT" + timeZoneId);
40
+ } else {
41
+ return TimeZone.getTimeZone("GMT+08:00");
42
+ }
43
+ }
11
44
  }
@@ -3,6 +3,15 @@ package com.cloudcc.core;
3
3
  public class UserInfo extends CCObject {
4
4
  // 绑定信息
5
5
  public String binding;
6
+ private String timeZone;
7
+
8
+ public String getTimeZone() {
9
+ return timeZone;
10
+ }
11
+
12
+ public void setTimeZone(String timeZone) {
13
+ this.timeZone = timeZone;
14
+ }
6
15
 
7
16
  // 获取用户ID
8
17
  public String getUserId() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "description": "cloudcc-cli",
5
5
  "author": "cloudcc",
6
6
  "license": "ISC",
@@ -16,6 +16,8 @@
16
16
  "cc-mcp": "bin/mcp.js"
17
17
  },
18
18
  "scripts": {
19
+ "test-cli-one": "node --test test/application.cli.test.js",
20
+ "test-cli-all": "node --test ",
19
21
  "cc-pull": "git fetch --tags -f && git pull",
20
22
  "publish-lib": "npm publish --registry https://registry.npmjs.org && git add . && git commit -m 'update' && git push && curl https://npmmirror.com/sync/cloudcc-cli",
21
23
  "package-jar": "mvn clean && mvn package",
@@ -43,5 +45,9 @@
43
45
  "vue-custom-element": "^3.3.0",
44
46
  "vue-template-compiler": "^2.6.14",
45
47
  "zod": "^4.1.13"
48
+ },
49
+ "devDependencies": {
50
+ "sass": "^1.98.0",
51
+ "sass-loader": "^16.0.7"
46
52
  }
47
53
  }
package/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <groupId>com.cloudcc.core</groupId>
6
6
  <artifactId>ccopenapi</artifactId>
7
- <version>0.0.3</version>
7
+ <version>0.0.4</version>
8
8
  <packaging>jar</packaging>
9
9
  <name>ccopenapi</name>
10
10
  <dependencies>
@@ -0,0 +1,114 @@
1
+ ## 覆盖范围
2
+
3
+ 本篇聚焦 CloudCC 后端 Java 侧二开资产(通过 `cc` 命令):
4
+
5
+ - 自定义类(Class)
6
+ - 定时类(Scheduled Class / Timer)
7
+ - 触发器(Trigger)
8
+
9
+ 并给出“创建 → 拉取 → 编辑 → 发布”的闭环流程。
10
+
11
+ ---
12
+
13
+ ## 目录结构(以本仓库约定为准)
14
+
15
+ 创建后通常会生成在以下目录(项目根下):
16
+
17
+ - `classes/{ClassName}/...`
18
+ - `schedule/{ScheduleName}/...`
19
+ - `triggers/{objectName}/{triggerName}/...`
20
+
21
+ ---
22
+
23
+ ## 源码同步边界(必须理解)
24
+
25
+ 该项目使用“片段同步”策略:
26
+
27
+ - **自定义类 / 定时类 / 触发器**:只会拉取/发布 `@SOURCE_CONTENT_START` 与 `@SOURCE_CONTENT_END` 之间的内容。
28
+
29
+ 这意味着:
30
+
31
+ - 你可以在片段外保留模板、import、类结构等;真正可同步的业务逻辑写在片段内。
32
+ - 拉取会覆盖片段区域,因此片段内不要放本地专用逻辑(如临时调试代码)。
33
+
34
+ ---
35
+
36
+ ## 自定义类(Class)
37
+
38
+ ### 创建
39
+
40
+ ```bash
41
+ # 在项目根目录执行
42
+ cc create classes <ClassName>
43
+ ```
44
+
45
+ ### 拉取 / 发布(片段同步)
46
+
47
+ ```bash
48
+ cc pull classes <ClassName>
49
+ cc publish classes <ClassName>
50
+ ```
51
+
52
+ > 说明:发布/拉取只会处理 `@SOURCE_CONTENT_START` 与 `@SOURCE_CONTENT_END` 之间的代码片段。
53
+
54
+ ---
55
+
56
+ ## 定时类(Scheduled Class)
57
+
58
+ ### 创建
59
+
60
+ ```bash
61
+ # 在项目根目录执行
62
+ cc create schedule <ScheduleName>
63
+ cc pull schedule <ScheduleName>
64
+ cc publish schedule <ScheduleName>
65
+ ```
66
+
67
+ ---
68
+
69
+ ## 触发器(Trigger)
70
+
71
+ ### 创建(关键入参)
72
+
73
+ 触发器的 CLI 创建参数是一个 JSON 对象(需要 `encodeURI` 后作为单参传入):
74
+
75
+ ```bash
76
+ cc create triggers <encodedJson>
77
+ ```
78
+
79
+ JSON 字段(示例):
80
+
81
+ - `name`: 触发器名(Java 命名规范)
82
+ - `schemetableName`: 对象表名(如从对象列表拿到)
83
+ - `targetObjectId`: 目标对象 ID
84
+ - `triggerTime`: 触发时机(beforeInsert/afterUpdate/.../approval 等)
85
+
86
+ 示例(macOS/zsh,注意引号与编码):
87
+
88
+ ```bash
89
+ cc create triggers "$(node -e 'console.log(encodeURI(JSON.stringify({name:\"MyTrigger\",schemetableName:\"account\",targetObjectId:\"a01...\",triggerTime:\"beforeInsert\"})))')"
90
+ ```
91
+
92
+ ### 拉取 / 发布
93
+
94
+ ```bash
95
+ # namePath 形如:objectName/triggerName(注意 objectName 通常为小写目录)
96
+ cc pull triggers <namePath>
97
+ cc publish triggers <namePath>
98
+ ```
99
+
100
+ > 说明:发布/拉取只会处理 `@SOURCE_CONTENT_START` 与 `@SOURCE_CONTENT_END` 之间的代码片段。
101
+
102
+ ---
103
+
104
+ ## 推荐工作流(AI 执行顺序)
105
+
106
+ 当需求涉及后端逻辑时,建议 AI 按以下顺序执行:
107
+
108
+ 1. 通过对象/字段工具确认数据结构(必要时先建对象字段)
109
+ 2. 创建类/触发器/定时器骨架(create_*)
110
+ 3. 拉取线上版本(pull_*)对齐基线(如是增量改造)
111
+ 4. 编写片段内业务逻辑(注意批量与幂等)
112
+ 5. 发布(publish_*)
113
+ 6. 回归验证:单条、批量、权限、异常分支
114
+
@@ -0,0 +1,90 @@
1
+ ## CLI 入口速查(本仓库已定义)
2
+
3
+ `package.json` 中定义的 bin:
4
+
5
+ - `cc`:主入口(支持 `create` / `get` / `pull` / `publish` / `doc` 等)
6
+ - `cloudccCreate`:创建模板项目(内部调用 `src/project/create.js`)
7
+ - `cloudccBuild`:组件发布/构建相关(内部调用 `src/plugin/publish.js`)
8
+
9
+ ---
10
+
11
+ ## 常用 CLI 命令速查(按开发流程分组)
12
+
13
+ ### 项目与文档
14
+
15
+ ```bash
16
+ # 版本
17
+ cc -v
18
+
19
+ # 创建模板项目
20
+ cc create project <projectName>
21
+
22
+ # 输出项目文档(纯 CLI 文档)
23
+ cc doc project overview
24
+ cc doc project key-guide
25
+ ```
26
+
27
+ ### 对象与字段
28
+
29
+ ```bash
30
+ # 创建自定义对象
31
+ cc create object <projectPath> <label>
32
+
33
+ # 查询对象列表(输出 JSON)
34
+ # type 可选:standard / custom / both(默认:both)
35
+ cc get object <projectPath> [type]
36
+
37
+ # 查询对象字段(输出 JSON)
38
+ cc get fields <projectPath> <objprefix>
39
+
40
+ # 创建字段(字段类型决定参数个数)
41
+ cc create fields <projectPath> <fieldType> <objid> <nameLabel> [ptext|lookupObj]
42
+ ```
43
+
44
+ ### 菜单与应用
45
+
46
+ ```bash
47
+ # 创建菜单(标签页)
48
+ cc create menu <type> <projectPath> <resourceId> <tabName> [tabStyle] [mobileimg] [cloudccservicetab]
49
+
50
+ # 创建应用
51
+ cc create application <projectPath> <appName> <appCode> [menuIds]
52
+ ```
53
+
54
+ ### 自定义类(classes)
55
+
56
+ ```bash
57
+ cc create classes <ClassName>
58
+ cc pull classes <ClassName>
59
+ cc publish classes <ClassName>
60
+ ```
61
+
62
+ ### 定时类(schedule)
63
+
64
+ ```bash
65
+ cc create schedule <ScheduleName>
66
+ cc pull schedule <ScheduleName>
67
+ cc publish schedule <ScheduleName>
68
+ ```
69
+
70
+ ### 触发器(triggers)
71
+
72
+ ```bash
73
+ # 创建:参数是一个 JSON(需 encodeURI 后作为单个参数传入)
74
+ cc create triggers <encodedJson>
75
+
76
+ # 拉取/发布:namePath 形如 objectName/triggerName
77
+ cc pull triggers <namePath>
78
+ cc publish triggers <namePath>
79
+ ```
80
+
81
+ ### 自定义组件(plugin / plugins)
82
+
83
+ ```bash
84
+ # 创建(生成到 plugins/<pluginName>/)
85
+ cc create plugin <pluginName>
86
+
87
+ # 发布(编译并上传)
88
+ cc publish plugin <pluginName>
89
+ ```
90
+
@@ -0,0 +1,59 @@
1
+ ## 目标
2
+
3
+ 让开发者(或 AI)在一台新机器上,完成 `cloudcc-cli` 的安装、模板项目创建、开发密钥配置,并能通过 `cc` 命令进行开发与发布。
4
+
5
+ ---
6
+
7
+ ## 安装 cloudcc-cli
8
+
9
+ ### 全局安装
10
+
11
+ ```bash
12
+ # Windows
13
+ npm i -g cloudcc-cli
14
+
15
+ # macOS(通常需要 sudo)
16
+ sudo npm i -g cloudcc-cli
17
+ ```
18
+
19
+ ### 验证版本
20
+
21
+ ```bash
22
+ cc -v
23
+ ```
24
+
25
+ > 说明:`cc` 是该 CLI 的统一入口命令之一(见本仓库 `package.json` 的 bin 配置)。
26
+
27
+ ---
28
+
29
+ ## 创建 CloudCC 模板项目
30
+
31
+ 在你的工作目录下执行:
32
+
33
+ ```bash
34
+ cc create project demo1
35
+ cd demo1
36
+ npm i
37
+ npm run serve
38
+ ```
39
+
40
+ 如果能在本地启动并访问页面,说明前端开发链路可用。
41
+
42
+ ---
43
+
44
+ ## 配置开发者密钥与安全标记
45
+
46
+ ### 在 CloudCC CRM 后台获取
47
+
48
+ 你需要一个具备“代码管理/开发者权限”的账号。
49
+
50
+ - **开发者密钥(CloudCCDev)**:在 CRM 后台「连接的应用程序」中新建后获取并复制。
51
+ - **安全标记(safetyMark)**:在个人设置中重置安全标记后,通过邮箱获取。
52
+
53
+ ### 写入项目的 `cloudcc-cli.config.js`
54
+
55
+ 模板项目根目录通常会有 `cloudcc-cli.config.js`(或你们约定的同名配置文件),核心原则:
56
+
57
+ - **多环境**:用 `use` 字段选择当前环境(如 `dev/uat/prod`)。
58
+ - **不要提交真实密钥到 Git**:建议 `.gitignore` 忽略配置文件,或用本地私密文件方式管理。
59
+