cloudcc-cli 2.3.4 → 2.3.6

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 (244) hide show
  1. package/.claude/settings.json +22 -1
  2. package/.cursor/skills/cloudcc-cli-dev/SKILL.md +175 -0
  3. package/.cursor/skills/cloudcc-dev-skill/SKILL.md +71 -0
  4. package/README.md +81 -6
  5. package/bin/cc.js +106 -28
  6. package/bin/index.js +54 -55
  7. package/mcp/cliRunner.js +11 -4
  8. package/mcp/index.js +12 -2
  9. package/mcp/tools/Application Creator/handler.js +1 -1
  10. package/mcp/tools/Approval/handler.js +3 -3
  11. package/mcp/tools/Class Creator/handler.js +2 -2
  12. package/mcp/tools/Class Detail Retriever/handler.js +1 -1
  13. package/mcp/tools/Class Editor Guide/handler.js +1 -1
  14. package/mcp/tools/Class List Retriever/handler.js +1 -1
  15. package/mcp/tools/Class Publisher/handler.js +1 -1
  16. package/mcp/tools/Class Puller/handler.js +1 -1
  17. package/mcp/tools/Client Script Detail Retriever/handler.js +1 -1
  18. package/mcp/tools/Client Script Editor Guide/handler.js +1 -1
  19. package/mcp/tools/Client Script List Retriever/handler.js +1 -1
  20. package/mcp/tools/Client Script Publisher/handler.js +1 -1
  21. package/mcp/tools/Client Script Puller/handler.js +2 -2
  22. package/mcp/tools/CloudCC Development Overview/handler.js +2 -2
  23. package/mcp/tools/Component Creator/handler.js +1 -1
  24. package/mcp/tools/Component Detail Retriever/handler.js +1 -1
  25. package/mcp/tools/Component Editor Guide/handler.js +1 -1
  26. package/mcp/tools/Component List Retriever/handler.js +1 -1
  27. package/mcp/tools/Component Publisher/handler.js +2 -2
  28. package/mcp/tools/Component Puller/handler.js +1 -1
  29. package/mcp/tools/Dev Environment Creator/handler.js +1 -1
  30. package/mcp/tools/Dev Environment Validator/handler.js +1 -1
  31. package/mcp/tools/Developer Key Setup Guide/handler.js +1 -1
  32. package/mcp/tools/JSP Migrator/handler.js +46 -0
  33. package/mcp/tools/Menu Creator/handler.js +1 -1
  34. package/mcp/tools/Object Creator/handler.js +2 -2
  35. package/mcp/tools/Object Fields Creator/handler.js +1 -1
  36. package/mcp/tools/Object Fields Retriever/handler.js +1 -1
  37. package/mcp/tools/Object List Retriever/handler.js +1 -1
  38. package/mcp/tools/Scheduled Class Creator/handler.js +1 -1
  39. package/mcp/tools/Scheduled Class Detail Retriever/handler.js +1 -1
  40. package/mcp/tools/Scheduled Class List Retriever/handler.js +1 -1
  41. package/mcp/tools/Scheduled Class Publisher/handler.js +1 -1
  42. package/mcp/tools/Scheduled Class Puller/handler.js +1 -1
  43. package/mcp/tools/Trigger Creator/handler.js +1 -1
  44. package/mcp/tools/Trigger Detail Retriever/handler.js +1 -1
  45. package/mcp/tools/Trigger Editor Guide/handler.js +1 -1
  46. package/mcp/tools/Trigger List Retriever/handler.js +1 -1
  47. package/mcp/tools/Trigger Publisher/handler.js +1 -1
  48. package/mcp/tools/Trigger Puller/handler.js +1 -1
  49. package/package.json +3 -3
  50. package/src/application/create.js +2 -2
  51. package/src/application/delete.js +2 -2
  52. package/src/application/doc.js +2 -2
  53. package/src/application/docs/devguide.md +25 -25
  54. package/src/application/docs/introduction.md +2 -2
  55. package/src/button/create.js +169 -0
  56. package/src/button/delete.js +35 -0
  57. package/src/button/doc.js +36 -0
  58. package/src/button/docs/devguide.md +133 -0
  59. package/src/button/docs/introduction.md +60 -0
  60. package/src/button/get.js +60 -0
  61. package/src/button/index.js +20 -0
  62. package/src/classes/create.js +1 -1
  63. package/src/classes/delete.js +1 -1
  64. package/src/classes/detail.js +1 -1
  65. package/src/classes/doc.js +2 -2
  66. package/src/classes/docs/devguide.md +21 -21
  67. package/src/classes/docs/introduction.md +0 -20
  68. package/src/classes/get.js +1 -1
  69. package/src/classes/publish.js +1 -1
  70. package/src/classes/pull.js +1 -1
  71. package/src/classes/pullList.js +1 -1
  72. package/src/config/doc.js +2 -2
  73. package/src/config/docs/devguide.md +15 -15
  74. package/src/customPage/create.js +2 -2
  75. package/src/customPage/delete.js +2 -2
  76. package/src/customPage/doc.js +2 -2
  77. package/src/customPage/docs/devguide.md +27 -27
  78. package/src/customPage/get.js +1 -1
  79. package/src/customSetting/create.js +1 -1
  80. package/src/customSetting/delete.js +1 -1
  81. package/src/customSetting/deleteCustomSettingField.js +1 -1
  82. package/src/customSetting/detail.js +1 -1
  83. package/src/customSetting/docs/devguide.md +9 -9
  84. package/src/customSetting/editCustomSettingField.js +1 -1
  85. package/src/customSetting/get.js +1 -1
  86. package/src/customSetting/modify.js +1 -1
  87. package/src/customSetting/saveCustomSettingField.js +1 -1
  88. package/src/fields/delete.js +2 -2
  89. package/src/fields/docs/devguide.md +14 -14
  90. package/src/fields/docs/introduction.md +3 -3
  91. package/src/globalSelectList/create.js +1 -1
  92. package/src/globalSelectList/delete.js +1 -1
  93. package/src/globalSelectList/detail.js +1 -1
  94. package/src/globalSelectList/doc.js +2 -2
  95. package/src/globalSelectList/docs/devguide.md +7 -7
  96. package/src/globalSelectList/get.js +1 -1
  97. package/src/identityProvider/create.js +78 -0
  98. package/src/identityProvider/delete.js +61 -0
  99. package/src/identityProvider/doc.js +46 -0
  100. package/src/identityProvider/docs/devguide.md +107 -0
  101. package/src/identityProvider/docs/introduction.md +31 -0
  102. package/src/identityProvider/download.js +105 -0
  103. package/src/identityProvider/get.js +70 -0
  104. package/src/identityProvider/index.js +12 -0
  105. package/src/menu/create-object.js +2 -2
  106. package/src/menu/create-page.js +2 -2
  107. package/src/menu/create-script.js +2 -2
  108. package/src/menu/create-site.js +2 -2
  109. package/src/menu/create.js +11 -11
  110. package/src/menu/delete.js +2 -2
  111. package/src/menu/doc.js +2 -2
  112. package/src/menu/docs/devguide.md +13 -13
  113. package/src/menu/docs/introduction.md +3 -3
  114. package/src/menu/get.js +1 -1
  115. package/src/object/create.js +2 -2
  116. package/src/object/delete.js +2 -2
  117. package/src/object/docs/devguide.md +11 -11
  118. package/src/pagelayout/create.js +6 -6
  119. package/src/pagelayout/delete.js +4 -4
  120. package/src/pagelayout/doc.js +2 -2
  121. package/src/pagelayout/docs/devguide.md +9 -9
  122. package/src/pagelayout/docs/introduction.md +1 -1
  123. package/src/pagelayout/get.js +4 -4
  124. package/src/permission/add.js +164 -0
  125. package/src/permission/assign.js +84 -0
  126. package/src/permission/docs/devguide.md +238 -0
  127. package/src/permission/docs/introduction.md +200 -0
  128. package/src/permission/get.js +107 -0
  129. package/src/permission/index.js +10 -0
  130. package/src/permission/remove.js +145 -0
  131. package/src/plugin/delete.js +2 -2
  132. package/src/plugin/doc.js +2 -2
  133. package/src/plugin/docs/devguide.md +29 -29
  134. package/src/profile/create.js +5 -5
  135. package/src/profile/delete.js +2 -2
  136. package/src/profile/doc.js +2 -2
  137. package/src/profile/docs/devguide.md +8 -8
  138. package/src/profile/docs/introduction.md +12 -12
  139. package/src/profile/get.js +1 -1
  140. package/src/project/docs/devguide.md +9 -8
  141. package/src/recordType/create.js +1 -1
  142. package/src/recordType/delete.js +1 -1
  143. package/src/recordType/doc.js +2 -2
  144. package/src/recordType/docs/devguide.md +10 -10
  145. package/src/recordType/editInfo.js +1 -1
  146. package/src/recordType/editSave.js +1 -1
  147. package/src/recordType/getList.js +1 -1
  148. package/src/recordType/newInfo.js +1 -1
  149. package/src/recordType/validDelete.js +1 -1
  150. package/src/res.md +1 -1
  151. package/src/role/create.js +6 -6
  152. package/src/role/delete.js +2 -2
  153. package/src/role/doc.js +2 -2
  154. package/src/role/docs/devguide.md +9 -9
  155. package/src/role/docs/introduction.md +13 -13
  156. package/src/role/get.js +1 -1
  157. package/src/scheduleJob/doc.js +1 -1
  158. package/src/scheduleJob/docs/devguide.md +6 -6
  159. package/src/scheduleJob/docs/introduction.md +6 -6
  160. package/src/script/docs/devguide.md +18 -18
  161. package/src/singleSignOn/delete.js +61 -0
  162. package/src/singleSignOn/doc.js +46 -0
  163. package/src/singleSignOn/docs/devguide.md +61 -0
  164. package/src/singleSignOn/docs/introduction.md +3 -0
  165. package/src/singleSignOn/get.js +70 -0
  166. package/src/singleSignOn/index.js +10 -0
  167. package/src/staticResource/count.js +1 -1
  168. package/src/staticResource/create.js +1 -1
  169. package/src/staticResource/delete.js +1 -1
  170. package/src/staticResource/detail.js +1 -1
  171. package/src/staticResource/docs/devguide.md +11 -11
  172. package/src/staticResource/docs/introduction.md +44 -1
  173. package/src/staticResource/get.js +1 -1
  174. package/src/timer/create.js +1 -1
  175. package/src/timer/delete.js +1 -1
  176. package/src/timer/detail.js +1 -1
  177. package/src/timer/doc.js +2 -2
  178. package/src/timer/docs/devguide.md +19 -19
  179. package/src/timer/get.js +1 -1
  180. package/src/timer/publish.js +1 -1
  181. package/src/timer/pull.js +1 -1
  182. package/src/timer/pullList.js +1 -1
  183. package/src/triggers/detail.js +1 -1
  184. package/src/triggers/doc.js +2 -2
  185. package/src/triggers/docs/devguide.md +23 -23
  186. package/src/triggers/get.js +1 -1
  187. package/src/triggers/pullList.js +1 -1
  188. package/src/user/create.js +2 -2
  189. package/src/user/delete.js +2 -2
  190. package/src/user/doc.js +2 -2
  191. package/src/user/docs/devguide.md +13 -13
  192. package/src/user/docs/introduction.md +12 -12
  193. package/src/user/get.js +1 -1
  194. package/src/user/update.js +3 -3
  195. package/src/user/view.js +2 -2
  196. package/src/validationRule/create.js +7 -7
  197. package/src/validationRule/delete.js +2 -2
  198. package/src/validationRule/doc.js +2 -2
  199. package/src/validationRule/docs/devguide.md +7 -7
  200. package/src/validationRule/docs/introduction.md +11 -11
  201. package/src/validationRule/get.js +1 -1
  202. package/src/version/actionHelp.js +25 -0
  203. package/src/version/docs.js +26 -0
  204. package/src/version/doctor.js +25 -0
  205. package/src/version/get.js +1 -1
  206. package/src/version/help.js +48 -0
  207. package/src/version/index.js +9 -2
  208. package/src/version/initHelp.js +13 -0
  209. package/src/version/listModuleCommands.js +241 -0
  210. package/src/version/stats.js +44 -0
  211. package/src/version/uninstall.js +30 -0
  212. package/src/version/update.js +13 -0
  213. package/test/application.cli.test.js +1 -1
  214. package/test/classes.cli.test.js +1 -1
  215. package/test/customSetting.cli.test.js +1 -1
  216. package/test/fields.cli.test.js +2 -2
  217. package/test/globalSelectList.cli.test.js +1 -1
  218. package/test/menu-script.cli.test.js +1 -1
  219. package/test/menu.cli.test.js +1 -1
  220. package/test/object.cli.test.js +1 -1
  221. package/test/plugin.cli.test.js +1 -1
  222. package/test/scheduleJob.cli.test.js +1 -1
  223. package/test/script.cli.test.js +1 -1
  224. package/test/staticResource.cli.test.js +1 -1
  225. package/test/timer.cli.test.js +1 -1
  226. package/test/trigger.cli.test.js +1 -1
  227. package/utils/checkVersion.js +27 -2
  228. package/utils/commandStats.js +94 -0
  229. package/utils/formatReleaseNotes.js +312 -0
  230. package/utils/readmeReleases.js +69 -0
  231. package/.cloudcc-cache.json +0 -54
  232. package/.cursor/skills/cloudcc-cli-dev.zip +0 -0
  233. package/.cursor/skills/cloudcc-dev-usage/SKILL.md +0 -68
  234. package/build/component-cc-cc-dd.common.js +0 -831
  235. package/build/component-cc-cc-dd.common.js.map +0 -1
  236. package/build/component-cc-cc-dd.css +0 -1
  237. package/build/component-cc-cc-dd.umd.js +0 -874
  238. package/build/component-cc-cc-dd.umd.js.map +0 -1
  239. package/build/component-cc-cc-dd.umd.min.js +0 -8
  240. package/build/component-cc-cc-dd.umd.min.js.map +0 -1
  241. package/build/demo.html +0 -1
  242. package/plugins/cc-cc-dd/cc-cc-dd.vue +0 -32
  243. package/plugins/cc-cc-dd/components/HelloWorld.vue +0 -11
  244. package/plugins/cc-cc-dd/config.json +0 -6
@@ -1,6 +1,6 @@
1
1
  # CloudCC 自定义设置操作指南
2
2
 
3
- 直接查看 CLI 文档:`cc doc customSetting`
3
+ 直接查看 CLI 文档:`cloudcc doc customSetting`
4
4
 
5
5
  ---
6
6
 
@@ -62,7 +62,7 @@
62
62
  #### 1) 查询自定义设置列表
63
63
  命令:
64
64
  ```bash
65
- cc get customSetting <projectPath> [encodedCondJson]
65
+ cloudcc get customSetting <projectPath> [encodedCondJson]
66
66
  ```
67
67
  请求参数:
68
68
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -72,7 +72,7 @@ cc get customSetting <projectPath> [encodedCondJson]
72
72
  #### 2) 查询自定义设置详情(含字段列表)
73
73
  命令:
74
74
  ```bash
75
- cc detail customSetting <projectPath> <settingId>
75
+ cloudcc detail customSetting <projectPath> <settingId>
76
76
  ```
77
77
  请求参数:
78
78
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -82,7 +82,7 @@ cc detail customSetting <projectPath> <settingId>
82
82
  #### 3) 新建/更新自定义设置主对象
83
83
  命令:
84
84
  ```bash
85
- cc create customSetting <projectPath> <encodedBodyJson>
85
+ cloudcc create customSetting <projectPath> <encodedBodyJson>
86
86
  ```
87
87
  请求参数:
88
88
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -101,7 +101,7 @@ cc create customSetting <projectPath> <encodedBodyJson>
101
101
  #### 4) 编辑前回显主对象表单数据
102
102
  命令:
103
103
  ```bash
104
- cc modify customSetting <projectPath> <settingId>
104
+ cloudcc modify customSetting <projectPath> <settingId>
105
105
  ```
106
106
  请求参数:
107
107
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -111,7 +111,7 @@ cc modify customSetting <projectPath> <settingId>
111
111
  #### 5) 删除自定义设置主对象
112
112
  命令:
113
113
  ```bash
114
- cc delete customSetting <projectPath> <settingId>
114
+ cloudcc delete customSetting <projectPath> <settingId>
115
115
  ```
116
116
  请求参数:
117
117
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -123,7 +123,7 @@ cc delete customSetting <projectPath> <settingId>
123
123
  #### 6) 进入字段编辑(取字段编辑所需数据)
124
124
  命令:
125
125
  ```bash
126
- cc editCustomSettingField customSetting <projectPath> <queryrecordid>
126
+ cloudcc editCustomSettingField customSetting <projectPath> <queryrecordid>
127
127
  ```
128
128
  请求参数:
129
129
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -133,7 +133,7 @@ cc editCustomSettingField customSetting <projectPath> <queryrecordid>
133
133
  #### 7) 保存字段(新增/编辑字段)
134
134
  命令:
135
135
  ```bash
136
- cc saveCustomSettingField customSetting <projectPath> <encodedBodyJson>
136
+ cloudcc saveCustomSettingField customSetting <projectPath> <encodedBodyJson>
137
137
  ```
138
138
  请求参数:
139
139
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -160,7 +160,7 @@ cc saveCustomSettingField customSetting <projectPath> <encodedBodyJson>
160
160
  #### 8) 删除自定义字段
161
161
  命令:
162
162
  ```bash
163
- cc deleteCustomSettingField customSetting <projectPath> <fieldId> <settingId>
163
+ cloudcc deleteCustomSettingField customSetting <projectPath> <fieldId> <settingId>
164
164
  ```
165
165
  请求参数:
166
166
  | 参数名称 | 类型 | 是否必须 | 默认值 | 备注 |
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 自定义设置字段 - 进入字段编辑(取字段编辑所需数据)
3
3
  * API: POST {setupSvc}/api/customsetting/editfile
4
- * CLI: cc editCustomSettingField customSetting <projectPath> <queryrecordid>
4
+ * CLI: cloudcc editCustomSettingField customSetting <projectPath> <queryrecordid>
5
5
  * 参数说明:
6
6
  * - projectPath: 项目根目录
7
7
  * - queryrecordid: 字段行 id
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 自定义设置 - 查询列表
3
3
  * API: POST {setupSvc}/api/customsetting/list
4
- * CLI: cc get customSetting <projectPath> [encodedCondJson]
4
+ * CLI: cloudcc get customSetting <projectPath> [encodedCondJson]
5
5
  * 参数说明:
6
6
  * - projectPath: 项目根目录
7
7
  * - encodedCondJson(可选): encodeURI(JSON.stringify(body))
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 自定义设置 - 编辑前回显(主对象)
3
3
  * API: POST {setupSvc}/api/customsetting/modify
4
- * CLI: cc modify customSetting <projectPath> <settingId>
4
+ * CLI: cloudcc modify customSetting <projectPath> <settingId>
5
5
  * 参数说明:
6
6
  * - projectPath: 项目根目录
7
7
  * - objid(命令参数名 settingId): 自定义设置 id
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * 自定义设置字段 - 保存字段(新增/编辑)
3
3
  * API: POST {setupSvc}/api/customsetting/saveField
4
- * CLI: cc saveCustomSettingField customSetting <projectPath> <encodedBodyJson>
4
+ * CLI: cloudcc saveCustomSettingField customSetting <projectPath> <encodedBodyJson>
5
5
  * 参数说明:
6
6
  * - projectPath: 项目根目录
7
7
  * - encodedBodyJson: encodeURI(JSON.stringify(body))
@@ -4,7 +4,7 @@ const { getPackageJson } = require("../../utils/config");
4
4
 
5
5
  /**
6
6
  * 删除字段(彻底删除)
7
- * 用法:cc delete fields <projectPath> <fieldId> <objid>
7
+ * 用法:cloudcc delete fields <projectPath> <fieldId> <objid>
8
8
  */
9
9
  async function remove(argvs) {
10
10
  const projectPath = argvs[2] || process.cwd();
@@ -14,7 +14,7 @@ async function remove(argvs) {
14
14
  if (!id || !objid) {
15
15
  console.error();
16
16
  console.error(chalk.red("Error: fieldId and objid are required"));
17
- console.error(chalk.yellow("Usage: cc delete fields <projectPath> <fieldId> <objid>"));
17
+ console.error(chalk.yellow("Usage: cloudcc delete fields <projectPath> <fieldId> <objid>"));
18
18
  console.error();
19
19
  return;
20
20
  }
@@ -7,8 +7,8 @@
7
7
  可通过以下命令读取文档:
8
8
 
9
9
  ```bash
10
- cc doc fields introduction
11
- cc doc fields devguide
10
+ cloudcc doc fields introduction
11
+ cloudcc doc fields devguide
12
12
  ```
13
13
 
14
14
  ---
@@ -16,9 +16,9 @@ cc doc fields devguide
16
16
  ## 2. 当前支持的命令
17
17
 
18
18
  ```bash
19
- cc get fields <projectPath> <objPrefix>
20
- cc create fields <projectPath> <fieldType> <objid> <fieldLabel> [extraArg]
21
- cc delete fields <projectPath> <fieldId> <objid>
19
+ cloudcc get fields <projectPath> <objPrefix>
20
+ cloudcc create fields <projectPath> <fieldType> <objid> <fieldLabel> [extraArg]
21
+ cloudcc delete fields <projectPath> <fieldId> <objid>
22
22
  ```
23
23
 
24
24
  说明:
@@ -43,7 +43,7 @@ cc delete fields <projectPath> <fieldId> <objid>
43
43
  ### 3.1 基本命令
44
44
 
45
45
  ```bash
46
- cc get fields <projectPath> <objPrefix>
46
+ cloudcc get fields <projectPath> <objPrefix>
47
47
  ```
48
48
 
49
49
  返回结果包含:
@@ -66,7 +66,7 @@ cc get fields <projectPath> <objPrefix>
66
66
  ### 4.1 基本命令
67
67
 
68
68
  ```bash
69
- cc create fields <projectPath> <fieldType> <objid> <fieldLabel> [extraArg]
69
+ cloudcc create fields <projectPath> <fieldType> <objid> <fieldLabel> [extraArg]
70
70
  ```
71
71
 
72
72
  建议:
@@ -119,8 +119,8 @@ cc create fields <projectPath> <fieldType> <objid> <fieldLabel> [extraArg]
119
119
  这两类字段创建时都需要额外的选项值参数:
120
120
 
121
121
  ```bash
122
- cc create fields <projectPath> L <objid> <fieldLabel> <ptext>
123
- cc create fields <projectPath> Q <objid> <fieldLabel> <ptext>
122
+ cloudcc create fields <projectPath> L <objid> <fieldLabel> <ptext>
123
+ cloudcc create fields <projectPath> Q <objid> <fieldLabel> <ptext>
124
124
  ```
125
125
 
126
126
  其中 `ptext` 表示选项内容,通常用于传入候选值集合。
@@ -144,9 +144,9 @@ cc create fields <projectPath> Q <objid> <fieldLabel> <ptext>
144
144
  这三类字段创建时都需要额外传入目标对象参数:
145
145
 
146
146
  ```bash
147
- cc create fields <projectPath> Y <objid> <fieldLabel> <lookupObj>
148
- cc create fields <projectPath> MR <objid> <fieldLabel> <lookupObj>
149
- cc create fields <projectPath> M <objid> <fieldLabel> <lookupObj>
147
+ cloudcc create fields <projectPath> Y <objid> <fieldLabel> <lookupObj>
148
+ cloudcc create fields <projectPath> MR <objid> <fieldLabel> <lookupObj>
149
+ cloudcc create fields <projectPath> M <objid> <fieldLabel> <lookupObj>
150
150
  ```
151
151
 
152
152
  其中 `lookupObj` 表示被关联对象。
@@ -196,7 +196,7 @@ cc create fields <projectPath> M <objid> <fieldLabel> <lookupObj>
196
196
  ### 5.1 基本命令
197
197
 
198
198
  ```bash
199
- cc delete fields <projectPath> <fieldId> <objid>
199
+ cloudcc delete fields <projectPath> <fieldId> <objid>
200
200
  ```
201
201
 
202
202
  删除前建议:
@@ -209,7 +209,7 @@ cc delete fields <projectPath> <fieldId> <objid>
209
209
 
210
210
  ## 6. 开发前检查
211
211
 
212
- - 已完成 `cc doc project devguide` 中的环境准备
212
+ - 已完成 `cloudcc doc project devguide` 中的环境准备
213
213
  - 项目根目录存在可用的 `cloudcc-cli.config.js`
214
214
  - 当前环境密钥配置正确
215
215
  - 已确认对象 API 名称、字段类型和命名规则
@@ -46,8 +46,8 @@ CloudCC 对象上的字段通常分为两类:
46
46
  可通过以下命令读取文档:
47
47
 
48
48
  ```bash
49
- cc doc fields introduction
50
- cc doc fields devguide
49
+ cloudcc doc fields introduction
50
+ cloudcc doc fields devguide
51
51
  ```
52
52
 
53
53
  ---
@@ -129,7 +129,7 @@ cc doc fields devguide
129
129
  - CloudCC 平台支持的完整字段能力
130
130
  - 当前 CLI 已实现的字段创建能力
131
131
 
132
- 命令开发与自动化脚本,应以 `cc doc fields devguide` 中列出的“当前 CLI
132
+ 命令开发与自动化脚本,应以 `cloudcc doc fields devguide` 中列出的“当前 CLI
133
133
  支持字段类型”为准。
134
134
 
135
135
  ---
@@ -3,7 +3,7 @@ const { getPackageJson } = require("../../utils/config");
3
3
  const { postClass } = require("../../utils/http");
4
4
 
5
5
  /**
6
- * cc create globalSelectList [projectPath] [encodedBodyJson]
6
+ * cloudcc create globalSelectList [projectPath] [encodedBodyJson]
7
7
  *
8
8
  * encodedBodyJson 示例(URI 编码前):
9
9
  * {
@@ -3,7 +3,7 @@ const { getPackageJson } = require("../../utils/config");
3
3
  const { postClass } = require("../../utils/http");
4
4
 
5
5
  /**
6
- * cc delete globalSelectList [projectPath] [id]
6
+ * cloudcc delete globalSelectList [projectPath] [id]
7
7
  *
8
8
  * 删除逻辑:
9
9
  * 1. 先以 deleteFromDisk=false 执行软删除
@@ -2,7 +2,7 @@ const { getPackageJson } = require("../../utils/config");
2
2
  const { postClass } = require("../../utils/http");
3
3
 
4
4
  /**
5
- * cc detail globalSelectList [projectPath] [id]
5
+ * cloudcc detail globalSelectList [projectPath] [id]
6
6
  *
7
7
  * 返回结构:
8
8
  * {
@@ -27,14 +27,14 @@ function getDevGuideDoc() {
27
27
  }
28
28
 
29
29
  /**
30
- * cc doc globalSelectList <introduction|devguide>
30
+ * cloudcc doc globalSelectList <introduction|devguide>
31
31
  * @param {string[]} argvs [doc, type, introduction|devguide, ...]
32
32
  */
33
33
  function doc(argvs) {
34
34
  const subType = argvs[2];
35
35
  const key = String(subType || "").trim().toLowerCase();
36
36
  if (!key) {
37
- throw new Error("cc doc globalSelectList 需要子命令:introduction 或 devguide");
37
+ throw new Error("cloudcc doc globalSelectList 需要子命令:introduction 或 devguide");
38
38
  }
39
39
  if (key === "introduction") {
40
40
  const content = getIntroductionDoc();
@@ -35,7 +35,7 @@
35
35
  参数使用 `encodeURI` 编码后传入(保留 `"` 和 `:` 等 JSON 必要字符):
36
36
 
37
37
  ```bash
38
- cc create globalSelectList . '%7B%22label%22:%22%E5%AE%A2%E6%88%B7%E7%AD%89%E7%BA%A7%22,%22name%22:%22customer_level%22,%22description%22:%22%E5%AE%A2%E6%88%B7%E7%AD%89%E7%BA%A7%E5%88%86%E7%B1%BB%22,%22ptext%22:%22%E6%99%AE%E9%80%9A%5Cr%5Cn%E9%93%B6%E7%89%8C%5Cr%5Cn%E9%87%91%E7%89%8C%22,%22isPicklistSorted%22:%220%22,%22isFirstDefault%22:%220%22%7D'
38
+ cloudcc create globalSelectList . '%7B%22label%22:%22%E5%AE%A2%E6%88%B7%E7%AD%89%E7%BA%A7%22,%22name%22:%22customer_level%22,%22description%22:%22%E5%AE%A2%E6%88%B7%E7%AD%89%E7%BA%A7%E5%88%86%E7%B1%BB%22,%22ptext%22:%22%E6%99%AE%E9%80%9A%5Cr%5Cn%E9%93%B6%E7%89%8C%5Cr%5Cn%E9%87%91%E7%89%8C%22,%22isPicklistSorted%22:%220%22,%22isFirstDefault%22:%220%22%7D'
39
39
  ```
40
40
 
41
41
  原始 JSON(`encodeURI` 编码前):
@@ -59,10 +59,10 @@ cc create globalSelectList . '%7B%22label%22:%22%E5%AE%A2%E6%88%B7%E7%AD%89%E7%B
59
59
 
60
60
  ```bash
61
61
  # 获取全部列表(默认分页 pageSize=10000)
62
- cc get globalSelectList
62
+ cloudcc get globalSelectList
63
63
 
64
64
  # 指定项目路径
65
- cc get globalSelectList /path/to/project
65
+ cloudcc get globalSelectList /path/to/project
66
66
  ```
67
67
 
68
68
  返回结果为 `globalSelectList` 数组,每条记录包含:
@@ -85,7 +85,7 @@ cc get globalSelectList /path/to/project
85
85
  ## 4. 查看详情
86
86
 
87
87
  ```bash
88
- cc detail globalSelectList . <id>
88
+ cloudcc detail globalSelectList . <id>
89
89
  ```
90
90
 
91
91
  - `<id>`:全局选项列表的 ID,可从列表接口返回值中获取
@@ -129,7 +129,7 @@ cc detail globalSelectList . <id>
129
129
  ## 5. 删除全局选项列表
130
130
 
131
131
  ```bash
132
- cc delete globalSelectList . <id>
132
+ cloudcc delete globalSelectList . <id>
133
133
  ```
134
134
 
135
135
  删除逻辑分两步自动处理:
@@ -144,10 +144,10 @@ cc delete globalSelectList . <id>
144
144
 
145
145
  ```bash
146
146
  # 查看能力介绍
147
- cc doc globalSelectList introduction
147
+ cloudcc doc globalSelectList introduction
148
148
 
149
149
  # 查看操作指南(本文)
150
- cc doc globalSelectList devguide
150
+ cloudcc doc globalSelectList devguide
151
151
  ```
152
152
 
153
153
 
@@ -2,7 +2,7 @@ const { getPackageJson } = require("../../utils/config");
2
2
  const { postClass } = require("../../utils/http");
3
3
 
4
4
  /**
5
- * cc get globalSelectList [projectPath] [encodedCondJson]
5
+ * cloudcc get globalSelectList [projectPath] [encodedCondJson]
6
6
  * @param {string} projectPath
7
7
  * @param {string} encodedCondJson
8
8
  * @param {boolean} isMcp
@@ -0,0 +1,78 @@
1
+ const chalk = require("chalk");
2
+ const { postClass } = require("../../utils/http");
3
+ const { getPackageJson } = require("../../utils/config");
4
+
5
+ /**
6
+ * 创建身份提供商
7
+ * 接口: /samlSp/save
8
+ * 用法:cloudcc create identityProvider <path> <entityid> <acsurl>
9
+ */
10
+ async function create(argvs) {
11
+ try {
12
+ const projectPath = argvs[2] || process.cwd();
13
+ const entityid = argvs[3];
14
+ const acsurl = argvs[4];
15
+
16
+ if (!entityid || !acsurl) {
17
+ console.error();
18
+ console.error(chalk.red("Error: 缺少必需参数"));
19
+ console.error(chalk.yellow("用法: cloudcc create identityProvider <path> <entityid> <acsurl>"));
20
+ console.error(chalk.yellow("示例: cloudcc create identityProvider . 'http://testdev.cloudcc.cn/ccdomaingateway/apisvc' 'http://testdev.cloudcc.cn/ccdomaingateway/apisvc/saml2/sp/sso/acs'"));
21
+ console.error();
22
+ throw new Error("缺少必需参数: entityid 和 acsurl");
23
+ }
24
+
25
+ const config = await getPackageJson(projectPath);
26
+ if (!config || !config.accessToken) {
27
+ console.error();
28
+ console.error(chalk.red("Error: 配置未找到或 accessToken 缺失"));
29
+ console.error();
30
+ throw new Error("配置未找到或 accessToken 缺失");
31
+ }
32
+
33
+ console.error();
34
+ console.error(chalk.green(`Creating identity provider, please wait...`));
35
+ console.error();
36
+
37
+ // 构建请求参数
38
+ const body = {
39
+ entityid: entityid,
40
+ acsurl: acsurl,
41
+ issuername: "",
42
+ nameidtype: "FederationId",
43
+ nameidformat: "1",
44
+ enablelogout: false,
45
+ logouturl: "",
46
+ custattrname: "",
47
+ id: ""
48
+ };
49
+
50
+ const res = await postClass(
51
+ config.setupSvc + "/api/samlSp/save",
52
+ body,
53
+ config.accessToken
54
+ );
55
+
56
+ if (res && res.result) {
57
+ console.error();
58
+ console.error(chalk.green("Success! Identity provider created."));
59
+ if (res.data) {
60
+ console.error(chalk.gray(`Response: ${JSON.stringify(res.data, null, 2)}`));
61
+ }
62
+ console.error();
63
+ return res;
64
+ }
65
+
66
+ const msg = res && (res.returnInfo || res.message) ? (res.returnInfo || res.message) : "Unknown error";
67
+ console.error();
68
+ console.error(chalk.red("Error: " + msg));
69
+ console.error();
70
+ throw new Error("Create IdentityProvider Failed: " + msg);
71
+ } catch (error) {
72
+ console.error();
73
+ console.error(chalk.red("身份提供商创建失败:"), error.message || error);
74
+ throw error;
75
+ }
76
+ }
77
+
78
+ module.exports = create;
@@ -0,0 +1,61 @@
1
+ const chalk = require("chalk");
2
+ const { postClass } = require("../../utils/http");
3
+ const { getPackageJson } = require("../../utils/config");
4
+
5
+ /**
6
+ * 删除身份提供商
7
+ * 接口: /samlSp/delete
8
+ * 用法:cloudcc delete identityProvider <projectPath> <appId>
9
+ */
10
+ async function remove(argvs) {
11
+ try {
12
+ const projectPath = argvs[2] || process.cwd();
13
+ const appId = argvs[3];
14
+
15
+ if (!appId) {
16
+ console.error();
17
+ console.error(chalk.red("Error: 缺少身份提供商 app ID"));
18
+ console.error(chalk.yellow("用法: cloudcc delete identityProvider <projectPath> <appId>"));
19
+ console.error(chalk.yellow("示例: cloudcc delete identityProvider . QbjH30d9Oy"));
20
+ console.error();
21
+ throw new Error("缺少必需参数: appId");
22
+ }
23
+
24
+ const config = await getPackageJson(projectPath);
25
+ if (!config || !config.accessToken) {
26
+ console.error();
27
+ console.error(chalk.red("Error: 配置未找到或 accessToken 缺失"));
28
+ console.error();
29
+ throw new Error("配置未找到或 accessToken 缺失");
30
+ }
31
+
32
+ console.error();
33
+ console.error(chalk.green(`Deleting identity provider (${appId}), please wait...`));
34
+ console.error();
35
+
36
+ const result = await postClass(
37
+ config.setupSvc + "/api/samlSp/delete",
38
+ { app: appId },
39
+ config.accessToken
40
+ );
41
+
42
+ if (result && result.result) {
43
+ console.error();
44
+ console.error(chalk.green("Success! Identity provider deleted."));
45
+ console.error();
46
+ return result;
47
+ }
48
+
49
+ const msg = result && (result.returnInfo || result.message) ? (result.returnInfo || result.message) : "Unknown error";
50
+ console.error();
51
+ console.error(chalk.red("Error: " + msg));
52
+ console.error();
53
+ throw new Error("Delete IdentityProvider Failed: " + msg);
54
+ } catch (error) {
55
+ console.error();
56
+ console.error(chalk.red("身份提供商删除失败:"), error);
57
+ throw error;
58
+ }
59
+ }
60
+
61
+ module.exports = remove;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * identityProvider 文档入口:正文均在 `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
+ * cloudcc doc identityProvider <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("cloudcc doc identityProvider 需要子命令: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;
@@ -0,0 +1,107 @@
1
+ # CloudCC 身份提供商 CLI 命令说明
2
+
3
+ ## 支持的命令
4
+
5
+ | 操作 | 说明 |
6
+ |------|------|
7
+ | `create` | 创建新身份提供商 |
8
+ | `get` | 查询身份提供商列表 |
9
+ | `delete` | 删除身份提供商 |
10
+ | `download` | 下载身份提供商证书 |
11
+
12
+ ## CLI 命令详解
13
+
14
+ ### 创建身份提供商
15
+
16
+ ```bash
17
+ cloudcc create identityProvider <path> <entityid> <acsurl>
18
+ ```
19
+
20
+ **参数说明:**
21
+
22
+ | 参数 | 必填 | 说明 |
23
+ |------|------|------|
24
+ | `path` | 是 | 项目路径,`.` 表示当前目录 |
25
+ | `entityid` | 是 | 实体 ID(Service Provider Entity ID)|
26
+ | `acsurl` | 是 | ACS URL(Assertion Consumer Service URL)|
27
+
28
+ **示例:**
29
+
30
+ ```bash
31
+ # 创建身份提供商
32
+ cloudcc create identityProvider . "http://testdev.cloudcc.cn/ccdomaingateway/apisvc" "http://testdev.cloudcc.cn/ccdomaingateway/apisvc/saml2/sp/sso/acs"
33
+ ```
34
+
35
+ ### 查询身份提供商列表
36
+
37
+ ```bash
38
+ cloudcc get identityProvider <projectPath> [encodedCondJson]
39
+ ```
40
+
41
+ **参数说明:**
42
+
43
+ | 参数 | 必填 | 说明 |
44
+ |------|------|------|
45
+ | `projectPath` | 否 | 项目路径,默认当前目录 |
46
+ | `encodedCondJson` | 否 | URI 编码后的查询条件 JSON |
47
+
48
+ **查询条件参数:**
49
+
50
+ | 参数名 | 类型 | 说明 |
51
+ |--------|------|------|
52
+ | `start` | number | 起始位置,默认 0 |
53
+ | `limit` | number | 每页条数,默认 30 |
54
+ | `keyword` | string | 搜索关键词 |
55
+
56
+ **示例:**
57
+
58
+ ```bash
59
+ # 获取所有身份提供商
60
+ cloudcc get identityProvider .
61
+
62
+ # 带查询条件(搜索关键词)
63
+ cloudcc get identityProvider . '%7B%22keyword%22%3A%22test%22%2C%22limit%22%3A50%7D'
64
+ ```
65
+
66
+ ### 删除身份提供商
67
+
68
+ ```bash
69
+ cloudcc delete identityProvider <projectPath> <appId>
70
+ ```
71
+
72
+ **参数说明:**
73
+
74
+ | 参数 | 必填 | 说明 |
75
+ |------|------|------|
76
+ | `projectPath` | 否 | 项目路径,默认当前目录 |
77
+ | `appId` | 是 | 身份提供商的 app 字段值(从列表接口获取)|
78
+
79
+ **示例:**
80
+
81
+ ```bash
82
+ # 删除身份提供商
83
+ cloudcc delete identityProvider . QbjH30d9Oy
84
+ ```
85
+
86
+ ### 下载身份提供商证书
87
+
88
+ ```bash
89
+ cloudcc download identityProvider <projectPath> [savePath]
90
+ ```
91
+
92
+ **参数说明:**
93
+
94
+ | 参数 | 必填 | 说明 |
95
+ |------|------|------|
96
+ | `projectPath` | 否 | 项目路径,默认当前目录 |
97
+ | `savePath` | 否 | 证书保存路径,默认当前目录 |
98
+
99
+ **示例:**
100
+
101
+ ```bash
102
+ # 下载证书到当前目录
103
+ cloudcc download identityProvider .
104
+
105
+ # 下载证书到指定路径
106
+ cloudcc download identityProvider . ./certificates
107
+ ```
@@ -0,0 +1,31 @@
1
+ # 身份提供商介绍
2
+
3
+ ## 功能概述
4
+
5
+ 身份提供商(Identity Provider)模块用于管理 CloudCC 平台的 SAML 身份提供商配置,支持以下功能:
6
+
7
+ - **查看身份提供商列表**:查询已配置的所有 SAML 身份提供商
8
+ - **新建身份提供商**:创建新的 SAML 身份提供商配置
9
+ - **删除身份提供商**:删除已配置的 SAML 身份提供商
10
+ - **下载证书**:下载身份提供商的 SAML 证书
11
+
12
+ ## 适用场景
13
+
14
+ - 企业单点登录(SSO)集成
15
+ - SAML 2.0 身份提供商配置
16
+ - 多身份提供商管理
17
+
18
+ ## 字段说明
19
+
20
+ ### 身份提供商字段
21
+
22
+ | 字段名 | 说明 | 默认值 |
23
+ |--------|------|--------|
24
+ | `entityid` | Service Provider Entity ID | 用户输入 |
25
+ | `acsurl` | Assertion Consumer Service URL | 用户输入 |
26
+ | `issuername` | 签发者名称 | 空字符串 |
27
+ | `nameidtype` | Name ID 类型 | FederationId |
28
+ | `nameidformat` | Name ID 格式 | 1 |
29
+ | `enablelogout` | 启用注销 | false |
30
+ | `logouturl` | 注销 URL | 空字符串 |
31
+ | `custattrname` | 自定义属性名称 | 空字符串 |