cloudcc-cli 2.2.2 → 2.2.4
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/.vscode/settings.json +3 -0
- package/README.md +47 -0
- package/bin/cc.js +11 -35
- package/bin/index.js +33 -0
- package/bin/mcp-svc.js +13 -0
- package/bin/mcp.js +18 -0
- package/java/com/cloudcc/core/TriggerInvoker.java +17 -1
- package/package.json +16 -7
- package/pom.xml +1 -0
- package/prompt/DevelopmentEnvironmentConstruction.ts +133 -0
- package/prompt/ccdk.ts +1190 -0
- package/prompt/ccprompt.ts +8 -0
- package/prompt/cloudccdev.ts +109 -0
- package/prompt/index.ts +52 -0
- package/prompt/objectInfo.ts +94 -0
- package/prompt/objectList.ts +25 -0
- package/prompt/openapi.ts +310 -0
- package/prompt/system.ts +14 -0
- package/prompt/vscodeExtension.ts +27 -0
- package/src/approval/approve.js +105 -0
- package/src/approval/get.js +245 -0
- package/src/approval/index.js +11 -0
- package/src/approval/reject.js +105 -0
- package/src/brief/get.js +51 -0
- package/src/brief/index.js +7 -0
- package/src/config/get.js +1 -1
- package/src/fields/create.js +204 -0
- package/src/fields/fields/A.js +23 -0
- package/src/fields/fields/AD.js +25 -0
- package/src/fields/fields/B.js +28 -0
- package/src/fields/fields/C.js +28 -0
- package/src/fields/fields/D.js +27 -0
- package/src/fields/fields/E.js +28 -0
- package/src/fields/fields/ENC.js +28 -0
- package/src/fields/fields/ENCD.js +28 -0
- package/src/fields/fields/F.js +27 -0
- package/src/fields/fields/FL.js +25 -0
- package/src/fields/fields/H.js +27 -0
- package/src/fields/fields/IMG.js +27 -0
- package/src/fields/fields/J.js +26 -0
- package/src/fields/fields/L.js +32 -0
- package/src/fields/fields/LT.js +28 -0
- package/src/fields/fields/M.js +29 -0
- package/src/fields/fields/MR.js +24 -0
- package/src/fields/fields/N.js +30 -0
- package/src/fields/fields/P.js +28 -0
- package/src/fields/fields/Q.js +35 -0
- package/src/fields/fields/S.js +30 -0
- package/src/fields/fields/SCORE.js +24 -0
- package/src/fields/fields/T.js +27 -0
- package/src/fields/fields/U.js +28 -0
- package/src/fields/fields/X.js +28 -0
- package/src/fields/fields/Y.js +33 -0
- package/src/fields/get.js +36 -0
- package/src/fields/index.js +9 -0
- package/src/mcp/MCP/345/234/272/346/231/257/346/250/241/346/213/237.md +8 -0
- package/src/mcp/index-sse-svc.js +126 -0
- package/src/mcp/index-streamable-svc.js +180 -0
- package/src/mcp/index.js +631 -0
- package/src/mcp/readme.md +137 -0
- package/src/mcp/tools/Approval/handler.js +349 -0
- package/src/mcp/tools/Class Creator/handler.js +37 -0
- package/src/mcp/tools/Class Detail Retriever/handler.js +33 -0
- package/src/mcp/tools/Class Detail Retriever/prompt.js +37 -0
- package/src/mcp/tools/Class Editor Guide/handler.js +72 -0
- package/src/mcp/tools/Class Editor Guide/prompt.js +468 -0
- package/src/mcp/tools/Class List Retriever/handler.js +36 -0
- package/src/mcp/tools/Class Publisher/handler.js +29 -0
- package/src/mcp/tools/Class Publisher/prompt.js +40 -0
- package/src/mcp/tools/Class Puller/handler.js +86 -0
- package/src/mcp/tools/Class Puller/prompt.js +49 -0
- package/src/mcp/tools/Client Script Creator/handler.js +179 -0
- package/src/mcp/tools/Client Script Detail Retriever/handler.js +53 -0
- package/src/mcp/tools/Client Script Editor Guide/handler.js +633 -0
- package/src/mcp/tools/Client Script List Retriever/handler.js +68 -0
- package/src/mcp/tools/Client Script Publisher/handler.js +54 -0
- package/src/mcp/tools/Client Script Puller/handler.js +73 -0
- package/src/mcp/tools/CloudCC Development Overview/handler.js +48 -0
- package/src/mcp/tools/CloudCC Development Overview/prompt.js +870 -0
- package/src/mcp/tools/Component Creator/handler.js +44 -0
- package/src/mcp/tools/Component Detail Retriever/handler.js +38 -0
- package/src/mcp/tools/Component Editor Guide/handler.js +76 -0
- package/src/mcp/tools/Component Editor Guide/prompt.js +519 -0
- package/src/mcp/tools/Component List Retriever/handler.js +43 -0
- package/src/mcp/tools/Component Publisher/handler.js +18 -0
- package/src/mcp/tools/Component Publisher/prompt.js +659 -0
- package/src/mcp/tools/Component Puller/handler.js +63 -0
- package/src/mcp/tools/Dev Environment Creator/fetcher.js +500 -0
- package/src/mcp/tools/Dev Environment Creator/handler.js +92 -0
- package/src/mcp/tools/Dev Environment Creator/prompt.js +273 -0
- package/src/mcp/tools/Dev Environment Validator/handler.js +88 -0
- package/src/mcp/tools/Dev Environment Validator/prompt.js +193 -0
- package/src/mcp/tools/Developer Key Setup Guide/fetcher.js +278 -0
- package/src/mcp/tools/Developer Key Setup Guide/handler.js +43 -0
- package/src/mcp/tools/Developer Key Setup Guide/prompt.js +71 -0
- package/src/mcp/tools/Object Creator/handler.js +34 -0
- package/src/mcp/tools/Object Fields Creator/handler.js +64 -0
- package/src/mcp/tools/Object Fields Retriever/handler.js +37 -0
- package/src/mcp/tools/Object Fields Retriever/prompt.js +10 -0
- package/src/mcp/tools/Object List Retriever/handler.js +43 -0
- package/src/mcp/tools/Object List Retriever/prompt.js +10 -0
- package/src/mcp/tools/Scheduled Class Creator/handler.js +37 -0
- package/src/mcp/tools/Scheduled Class Detail Retriever/handler.js +34 -0
- package/src/mcp/tools/Scheduled Class List Retriever/handler.js +52 -0
- package/src/mcp/tools/Scheduled Class Publisher/handler.js +30 -0
- package/src/mcp/tools/Scheduled Class Puller/handler.js +92 -0
- package/src/mcp/tools/Trigger Creator/handler.js +53 -0
- package/src/mcp/tools/Trigger Detail Retriever/handler.js +33 -0
- package/src/mcp/tools/Trigger Editor Guide/handler.js +58 -0
- package/src/mcp/tools/Trigger List Retriever/handler.js +49 -0
- package/src/mcp/tools/Trigger Publisher/handler.js +34 -0
- package/src/mcp/tools/Trigger Puller/handler.js +40 -0
- package/src/mcp/tools/ccdk/fetcher.js +18 -0
- package/src/mcp/tools/ccdk/handler.js +98 -0
- package/src/mcp/tools/ccdk/prompt.js +453 -0
- package/src/mcp/tools/index.js +23 -0
- package/src/object/create.js +105 -0
- package/src/object/get.js +43 -4
- package/src/object/index.js +2 -1
- package/src/plugin/create.js +1 -2
- package/src/plugin/create1.js +9 -9
- package/src/plugin/detail.js +91 -0
- package/src/plugin/get.js +79 -0
- package/src/plugin/index.js +4 -1
- package/src/plugin/publish.js +13 -13
- package/src/plugin/publish1.js +33 -24
- package/src/plugin/pull.js +173 -0
- package/src/project/create.js +9 -9
- package/src/project/create1.js +31 -17
- package/src/recordType/get.js +4 -2
- package/src/script/create.js +7 -7
- package/src/script/detail.js +95 -0
- package/src/script/get.js +4 -2
- package/src/script/index.js +1 -0
- package/src/script/publish.js +14 -14
- package/src/script/pull.js +12 -12
- package/src/script/pullList.js +5 -3
- package/src/timer/create.js +7 -7
- package/src/timer/detail.js +84 -0
- package/src/timer/get.js +6 -3
- package/src/timer/publish.js +7 -7
- package/src/timer/pull.js +8 -8
- package/src/timer/pullList.js +5 -3
- package/src/token/get.js +1 -1
- package/src/triggers/create.js +7 -7
- package/src/triggers/detail.js +90 -0
- package/src/triggers/get.js +4 -2
- package/src/triggers/index.js +1 -0
- package/src/triggers/publish.js +7 -7
- package/src/triggers/pull.js +8 -8
- package/src/triggers/pullList.js +5 -3
- package/src/version/get.js +3 -3
- package/target/ccopenapi-0.0.3-classes.jar +0 -0
- package/target/ccopenapi-0.0.3.jar +0 -0
- package/target/maven-archiver/pom.properties +3 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +18 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +19 -0
- package/template/Appvue +452 -12
- package/template/index.js +30 -19
- package/tool/branch/index.js +1 -1
- package/tool/checkLange/checkLang.js +6 -6
- package/tool/checkLange/clearLang.js +1 -1
- package/utils/accessClass.js +23 -0
- package/utils/checkVersion.js +22 -20
- package/utils/config.js +18 -3
- package/utils/http.js +10 -10
- package/utils/utils.js +128 -40
- package/java/com/cloudcc/core/CCTriggerDemo.java +0 -25
- package/src/classes/create.js +0 -65
- package/src/classes/get.js +0 -21
- package/src/classes/index.js +0 -11
- package/src/classes/publish.js +0 -50
- package/src/classes/pull.js +0 -54
- package/src/classes/pullList.js +0 -44
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
+
# Usage Guide
|
|
2
|
+
* Global Installation
|
|
3
|
+
```
|
|
4
|
+
// window
|
|
5
|
+
npm i -g cloudcc-cli
|
|
6
|
+
|
|
7
|
+
// macos
|
|
8
|
+
sudo npm i -g cloudcc-cli
|
|
9
|
+
```
|
|
10
|
+
* Configure MCP
|
|
11
|
+
```
|
|
12
|
+
{
|
|
13
|
+
"mcpServers": {
|
|
14
|
+
"cloudcc-cli": {
|
|
15
|
+
"command": "cc-mcp"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
# ReleaseV2.2.4
|
|
22
|
+
#### Release Date: 2026-1-19
|
|
23
|
+
#### Release Scope: Full
|
|
24
|
+
#### Release Content
|
|
25
|
+
* Optimization
|
|
26
|
+
* Add create object MCP
|
|
27
|
+
* Add query object list MCP
|
|
28
|
+
* Add trigger management MCP
|
|
29
|
+
* Add custom component management MCP
|
|
30
|
+
* Add client script management MCP
|
|
31
|
+
* Add buildVersion, use new version when v2
|
|
32
|
+
* Optimize configuration cache logic to avoid updating cached configuration every time
|
|
33
|
+
* Add pull custom component functionality
|
|
34
|
+
* Fix issue where class files could still be created even when configuration was missing
|
|
35
|
+
|
|
36
|
+
# ReleaseV2.2.3
|
|
37
|
+
#### Release Date: 2025-12-11
|
|
38
|
+
#### Release Scope: Full
|
|
39
|
+
#### Release Content
|
|
40
|
+
* Optimization
|
|
41
|
+
* Add development environment setup MCP service
|
|
42
|
+
* Add security key retrieval MCP service
|
|
43
|
+
* Add Class management MCP service
|
|
44
|
+
* Add custom component management MCP service
|
|
45
|
+
* Configuration information prioritized from config
|
|
46
|
+
* Fix script tag search logic
|
|
47
|
+
|
|
1
48
|
# ReleaseV2.2.2
|
|
2
49
|
#### Release Date: 2025-12-3
|
|
3
50
|
#### Release Scope: Full
|
package/bin/cc.js
CHANGED
|
@@ -12,50 +12,26 @@ if (action === '-version' || action === '-v' || action === '--version' || action
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
if (!action) {
|
|
15
|
-
console.
|
|
16
|
-
console.
|
|
17
|
-
console.
|
|
15
|
+
console.error()
|
|
16
|
+
console.error(chalk.yellow("Please see the help documentation"));
|
|
17
|
+
console.error()
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
let type = argvs[1]
|
|
23
23
|
if (!type) {
|
|
24
|
-
console.
|
|
25
|
-
console.
|
|
26
|
-
console.
|
|
24
|
+
console.error()
|
|
25
|
+
console.error(chalk.yellow("Please see the help documentation"));
|
|
26
|
+
console.error()
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
+
const cc = require("./index")
|
|
29
30
|
|
|
30
|
-
const cc = {}
|
|
31
|
-
|
|
32
|
-
cc.project = require("../src/project/index")
|
|
33
|
-
|
|
34
|
-
cc.plugin = require("../src/plugin/index")
|
|
35
|
-
|
|
36
|
-
cc.classes = require("../src/classes/index")
|
|
37
|
-
|
|
38
|
-
cc.schedule = require("../src/timer/index")
|
|
39
|
-
|
|
40
|
-
cc.triggers = require("../src/triggers/index")
|
|
41
|
-
|
|
42
|
-
cc.timer = require("../src/timer/index")
|
|
43
|
-
|
|
44
|
-
cc.script = require("../src/script/index")
|
|
45
|
-
|
|
46
|
-
cc.token = require("../src/token/index")
|
|
47
|
-
|
|
48
|
-
cc.object = require("../src/object/index")
|
|
49
|
-
|
|
50
|
-
cc.recordType = require("../src/recordType/index")
|
|
51
|
-
|
|
52
|
-
cc.config = require("../src/config/index")
|
|
53
|
-
|
|
54
|
-
cc.version = require("../src/version/index")
|
|
55
31
|
try {
|
|
56
32
|
cc[argvs[1]](argvs[0], argvs);
|
|
57
33
|
} catch (e) {
|
|
58
|
-
console.
|
|
59
|
-
console.
|
|
60
|
-
console.
|
|
61
|
-
}
|
|
34
|
+
console.error()
|
|
35
|
+
console.error(chalk.yellow("Please see the help documentation"), e);
|
|
36
|
+
console.error()
|
|
37
|
+
}
|
package/bin/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const cc = {}
|
|
2
|
+
|
|
3
|
+
cc.project = require("../src/project/index")
|
|
4
|
+
|
|
5
|
+
cc.plugin = require("../src/plugin/index")
|
|
6
|
+
|
|
7
|
+
cc.classes = require("../src/classes/index")
|
|
8
|
+
|
|
9
|
+
cc.schedule = require("../src/timer/index")
|
|
10
|
+
|
|
11
|
+
cc.triggers = require("../src/triggers/index")
|
|
12
|
+
|
|
13
|
+
cc.timer = require("../src/timer/index")
|
|
14
|
+
|
|
15
|
+
cc.script = require("../src/script/index")
|
|
16
|
+
|
|
17
|
+
cc.token = require("../src/token/index")
|
|
18
|
+
|
|
19
|
+
cc.object = require("../src/object/index")
|
|
20
|
+
|
|
21
|
+
cc.recordType = require("../src/recordType/index")
|
|
22
|
+
|
|
23
|
+
cc.config = require("../src/config/index")
|
|
24
|
+
|
|
25
|
+
cc.version = require("../src/version/index")
|
|
26
|
+
|
|
27
|
+
cc.brief = require("../src/brief/index")
|
|
28
|
+
|
|
29
|
+
cc.fields = require("../src/fields/index")
|
|
30
|
+
|
|
31
|
+
cc.approval = require("../src/approval/index")
|
|
32
|
+
|
|
33
|
+
module.exports = cc;
|
package/bin/mcp-svc.js
ADDED
package/bin/mcp.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP (Model Context Protocol) 服务启动脚本
|
|
4
|
+
* 用于与 Claude Desktop、IDE 等客户端通信
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { StdioServerTransport } = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
8
|
+
const mcpServer = require('../src/mcp/index.js');
|
|
9
|
+
|
|
10
|
+
async function main() {
|
|
11
|
+
const transport = new StdioServerTransport();
|
|
12
|
+
await mcpServer.connect(transport);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
main().catch(error => {
|
|
16
|
+
console.error('Server error:', error);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
});
|
|
@@ -5,6 +5,10 @@ import java.lang.reflect.InvocationTargetException;
|
|
|
5
5
|
import java.util.Set;
|
|
6
6
|
|
|
7
7
|
import org.reflections.Reflections;
|
|
8
|
+
import org.reflections.scanners.SubTypesScanner;
|
|
9
|
+
import org.reflections.util.ConfigurationBuilder;
|
|
10
|
+
import org.reflections.util.ClasspathHelper;
|
|
11
|
+
import org.apache.log4j.BasicConfigurator;
|
|
8
12
|
|
|
9
13
|
public class TriggerInvoker {
|
|
10
14
|
UserInfo uinfo = null;
|
|
@@ -25,8 +29,20 @@ public class TriggerInvoker {
|
|
|
25
29
|
public ServiceResult handler(CCObject data) throws Exception {
|
|
26
30
|
String objectApiName = data.getObjectApiName();
|
|
27
31
|
ServiceResult sr = new ServiceResult();
|
|
32
|
+
// 初始化 log4j,避免无 appender 的警告
|
|
33
|
+
try {
|
|
34
|
+
BasicConfigurator.configure();
|
|
35
|
+
} catch (Exception ignore) {
|
|
36
|
+
}
|
|
37
|
+
// 使用包名前缀的简便构造,这会启用默认的扫描器(包含 SubTypesScanner)
|
|
28
38
|
Reflections ref = new Reflections("com.cloudcc.trigger");
|
|
29
|
-
Set<Class<? extends CCTrigger>> clsSets =
|
|
39
|
+
Set<Class<? extends CCTrigger>> clsSets = null;
|
|
40
|
+
try {
|
|
41
|
+
clsSets = ref.getSubTypesOf(CCTrigger.class);
|
|
42
|
+
} catch (org.reflections.ReflectionsException rex) {
|
|
43
|
+
// 没有配置 SubTypesScanner 或未找到任何触发器时,使用空集合继续执行
|
|
44
|
+
clsSets = java.util.Collections.emptySet();
|
|
45
|
+
}
|
|
30
46
|
for (Class<? extends CCTrigger> subCls : clsSets) {
|
|
31
47
|
try {
|
|
32
48
|
Constructor cons = subCls.getConstructor(CCObject.class, CCObject.class, ServiceResult.class,
|
package/package.json
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloudcc-cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "cloudcc-cli",
|
|
5
|
+
"author": "cloudcc",
|
|
6
|
+
"license": "ISC",
|
|
5
7
|
"keywords": [
|
|
6
8
|
"cloudcc",
|
|
7
9
|
"cloudcc-cli"
|
|
8
10
|
],
|
|
9
|
-
"main": "
|
|
10
|
-
"author": "cloudcc",
|
|
11
|
-
"license": "ISC",
|
|
11
|
+
"main": "bin/index.js",
|
|
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
|
+
"cc-mcp": "bin/mcp.js"
|
|
16
17
|
},
|
|
17
18
|
"scripts": {
|
|
18
19
|
"cc-pull": "git fetch --tags -f && git pull",
|
|
19
20
|
"publish-lib": "npm publish --registry https://registry.npmjs.org && git add . && git commit -m 'update' && git push && curl https://npmmirror.com/sync/cloudcc-cli",
|
|
20
|
-
"package-jar": "mvn clean && mvn package"
|
|
21
|
+
"package-jar": "mvn clean && mvn package",
|
|
22
|
+
"fetch-dev-env": "node src/mcp/tools/dev-env/fetcher.js",
|
|
23
|
+
"fetch-key-guide": "node src/mcp/tools/key-guide/fetcher.js",
|
|
24
|
+
"fetch-ccdk": "node src/mcp/tools/ccdk/fetcher.js"
|
|
21
25
|
},
|
|
22
26
|
"dependencies": {
|
|
23
27
|
"@babel/parser": "^7.28.5",
|
|
24
28
|
"@babel/traverse": "^7.28.5",
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.23.0",
|
|
25
30
|
"axios": "^0.21.4",
|
|
26
31
|
"boxen": "^4.0.0",
|
|
27
32
|
"chalk": "^2.4.2",
|
|
33
|
+
"cheerio": "^1.0.0-rc.12",
|
|
28
34
|
"crypto-js": "^4.1.1",
|
|
29
35
|
"dayjs": "^1.10.7",
|
|
30
36
|
"fs-extra": "^11.2.0",
|
|
@@ -32,7 +38,10 @@
|
|
|
32
38
|
"marked": "^5.0.1",
|
|
33
39
|
"mem-fs": "^2.2.1",
|
|
34
40
|
"mem-fs-editor": "^9.0.1",
|
|
41
|
+
"node-fetch": "^3.3.2",
|
|
42
|
+
"pinyin": "^4.0.0",
|
|
35
43
|
"vue-custom-element": "^3.3.0",
|
|
36
|
-
"vue-template-compiler": "^2.6.14"
|
|
44
|
+
"vue-template-compiler": "^2.6.14",
|
|
45
|
+
"zod": "^4.1.13"
|
|
37
46
|
}
|
|
38
47
|
}
|
package/pom.xml
CHANGED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"title": "cloudcc开发环境搭建教程",
|
|
3
|
+
"description": "本文档是关于搭建cloudcc开发环境的教程。",
|
|
4
|
+
"content":
|
|
5
|
+
`
|
|
6
|
+
--------CloudCC 开发环境搭建指南开始--------
|
|
7
|
+
# CloudCC 开发环境搭建指南
|
|
8
|
+
## 本指南用于引导用户逐步完成 CloudCC 开发环境的搭建。
|
|
9
|
+
### 答复要求:
|
|
10
|
+
* 当用户咨询开发环境搭建相关问题时,请遵循本指南内容,逐步引导用户操作,每次仅提供一个步骤,避免一次性给出所有步骤。
|
|
11
|
+
* 当用户咨询自定义代码开发等非环境搭建相关问题时,请避免引用本指南内容。
|
|
12
|
+
### 适用范围:
|
|
13
|
+
* 本指南仅适用于解答 CloudCC 开发环境搭建问题,不适用于其他主题。
|
|
14
|
+
|
|
15
|
+
## 搭建步骤
|
|
16
|
+
### 安装 Node.js: 14.19.0(必须使用此版本)
|
|
17
|
+
下载链接:http://nodejs.cn/download/
|
|
18
|
+
|
|
19
|
+
推荐:使用 nvm(Node 版本管理器)来管理多个 Node.js 版本
|
|
20
|
+
|
|
21
|
+
### 包管理器:npm
|
|
22
|
+
为加快依赖安装速度,将 npm 注册表切换到阿里巴巴源:
|
|
23
|
+
npm config set registry https://registry.npmmirror.com
|
|
24
|
+
|
|
25
|
+
### 全局依赖
|
|
26
|
+
npm install -g @vue/cli@5.0.8
|
|
27
|
+
npm install -g @vue/cli-service-global@4.5.17
|
|
28
|
+
npm install -g cloudcc-cli
|
|
29
|
+
|
|
30
|
+
检查安装状态,确认这三个包可见:
|
|
31
|
+
npm ls -g --depth=0
|
|
32
|
+
|
|
33
|
+
### 安装 VS Code
|
|
34
|
+
下载链接:https://code.visualstudio.com/download
|
|
35
|
+
|
|
36
|
+
### 安装 CloudCC VS Code 插件:CloudCC。如已安装则忽略此步骤。
|
|
37
|
+
|
|
38
|
+
### 创建并运行项目
|
|
39
|
+
* cc create project demo1
|
|
40
|
+
* 使用 VS Code 打开此项目
|
|
41
|
+
* npm i
|
|
42
|
+
* npm run serve
|
|
43
|
+
|
|
44
|
+
### 打开 cloudcc-cli.config.js 文件,配置安全标记
|
|
45
|
+
#### 公有云配置
|
|
46
|
+
"devConsoleConfig": {
|
|
47
|
+
// CRM 开发者账户
|
|
48
|
+
"username": "xxx",
|
|
49
|
+
// 密钥
|
|
50
|
+
"secretKey": "xxx",
|
|
51
|
+
// 安全标记(通过系统重置安全标记邮件获取)
|
|
52
|
+
"safetyMark": "xxx",
|
|
53
|
+
// 注册时获得的客户端 ID
|
|
54
|
+
"clientId": "xxx",
|
|
55
|
+
// 注册时获得的密钥
|
|
56
|
+
"openSecretKey": "xxx",
|
|
57
|
+
// 组织 ID
|
|
58
|
+
"orgId": "xxx"
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
* secretKey获取方法
|
|
62
|
+
* 国内公有云 API 端点:https://developer.apis.cloudcc.cn/sysconfig/auth/secretkey/get
|
|
63
|
+
* 全球公有云 API 端点:https://global-gw.cloudcc.com/sysconfig/auth/secretkey/get
|
|
64
|
+
* 部署为公有云的私有云 API 端点:https://网关地址/systconfig/auth/secretkey/get
|
|
65
|
+
|
|
66
|
+
* 请求方法:POST
|
|
67
|
+
Content-Type: application/x-www-form-urlencoded
|
|
68
|
+
请求体:{"username":"xxx"}
|
|
69
|
+
curl -H "Content-Type: application/x-www-form-urlencoded" -d "username=cloudcc@xxxx" -X POST https://developer.apis.cloudcc.cn/sysconfig/auth/secretkey/get
|
|
70
|
+
|
|
71
|
+
参数名称 | 描述 | 类型 | 备注
|
|
72
|
+
safetyMark | 安全标记(通过系统重置安全标记邮件获取) | string | 必填
|
|
73
|
+
获取方法:个人信息 - 重置我的安全标记
|
|
74
|
+
clientId | 注册时获得的客户端 ID | string | 必填
|
|
75
|
+
获取方法:管理设置 - 安全控制 - 已连接的应用程序
|
|
76
|
+
openSecretKey | 注册时获得的密钥 | string | 必填
|
|
77
|
+
获取方法:管理设置 - 安全控制 - 已连接的应用程序
|
|
78
|
+
orgId | 组织 ID | string | 必填
|
|
79
|
+
|
|
80
|
+
#### 私有云配置
|
|
81
|
+
"devConsoleConfig": {
|
|
82
|
+
// CRM 开发者账户
|
|
83
|
+
"username": "admin@cloudccone.com",
|
|
84
|
+
// 密钥(必须与 sysconfig-svc 配置文件中的 cloudcc.private.secretKey 匹配,私有云默认值:abc)
|
|
85
|
+
"secretKey": "abc",
|
|
86
|
+
// 私有云需要配置网关地址,注意:URL 不应以 / 结尾
|
|
87
|
+
"baseUrl": "http://xxx",
|
|
88
|
+
// 私有云特有,固定格式用于标识私有云环境
|
|
89
|
+
"version": "private",
|
|
90
|
+
// 安全标记(通过系统重置安全标记邮件获取)
|
|
91
|
+
"safetyMark": "xxx",
|
|
92
|
+
// 注册时获得的客户端 ID
|
|
93
|
+
"clientId": "xxx",
|
|
94
|
+
// 注册时获得的密钥
|
|
95
|
+
"openSecretKey": "xxx",
|
|
96
|
+
// 组织 ID
|
|
97
|
+
"orgId": "xxx"
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
参数名称 | 描述 | 类型 | 备注
|
|
101
|
+
safetyMark | 安全标记(通过系统重置安全标记邮件获取) | string | 必填
|
|
102
|
+
获取方法:个人信息 - 重置我的安全标记
|
|
103
|
+
clientId | 注册时获得的客户端 ID | string | 必填
|
|
104
|
+
获取方法:管理设置 - 安全控制 - 已连接的应用程序
|
|
105
|
+
openSecretKey | 注册时获得的密钥 | string | 必填
|
|
106
|
+
获取方法:管理设置 - 安全控制 - 已连接的应用程序
|
|
107
|
+
orgId | 组织 ID | string | 必填
|
|
108
|
+
baseUrl | 网关地址 | string | 登录 CloudCC CRM 系统,按 F12,在控制台输入:$CCDK.CCConfig.getBaseUrl() 获取私有云的 baseUrl
|
|
109
|
+
|
|
110
|
+
#### 特殊配置
|
|
111
|
+
"devConsoleConfig": {
|
|
112
|
+
// 服务访问地址:
|
|
113
|
+
// 国内默认:https://developer.apis.cloudcc.cn
|
|
114
|
+
// 海外默认:https://developer.apis.cloudcc.com
|
|
115
|
+
"baseUrl": "http://xxx",
|
|
116
|
+
// 组件后台销毁时间,设置为 10 分钟(10*60*1000)
|
|
117
|
+
"destroyTimeout": 600000,
|
|
118
|
+
// 开发者平台网关前缀名称,注意:URL 不应以 / 结尾
|
|
119
|
+
"devSvcDispatch": "/devconsole",
|
|
120
|
+
// api-service 网关前缀地址,注意:URL 不应以 / 结尾
|
|
121
|
+
"apiSvcPrefix": "/xxx",
|
|
122
|
+
// setup-svc 网关前缀地址,注意:URL 不应以 / 结尾
|
|
123
|
+
"setupSvcPrefix": "/xxx"
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
### 在 VS Code 中打开已创建的项目,右键点击项目文件,选择创建组件。
|
|
127
|
+
|
|
128
|
+
### 将创建的组件导入到 App.vue 中
|
|
129
|
+
|
|
130
|
+
### 刷新浏览器以预览
|
|
131
|
+
--------CloudCC 开发环境搭建指南结束--------
|
|
132
|
+
`
|
|
133
|
+
};
|