cloudcc-cli 1.8.7 → 1.8.8

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 (57) hide show
  1. package/README.md +1319 -1312
  2. package/bin/cc.js +49 -49
  3. package/bin/plugin.js +5 -5
  4. package/bin/project.js +5 -5
  5. package/core/core/ServiceResult.java +35 -35
  6. package/core/core/UserInfo.java +45 -45
  7. package/package.json +34 -34
  8. package/src/classes/create.js +43 -43
  9. package/src/classes/index.js +8 -8
  10. package/src/classes/publish.js +45 -45
  11. package/src/config/get.js +20 -20
  12. package/src/config/index.js +8 -8
  13. package/src/config/use.js +14 -14
  14. package/src/object/get.js +35 -35
  15. package/src/object/index.js +7 -7
  16. package/src/plugin/create.js +70 -70
  17. package/src/plugin/create1.js +58 -58
  18. package/src/plugin/index.js +8 -8
  19. package/src/plugin/publish.js +267 -267
  20. package/src/plugin/publish1.js +297 -297
  21. package/src/plugin/readme.md +6 -6
  22. package/src/project/create.js +83 -83
  23. package/src/project/create1.js +105 -105
  24. package/src/project/index.js +7 -7
  25. package/src/recordType/get.js +13 -13
  26. package/src/recordType/index.js +7 -7
  27. package/src/script/create.js +35 -35
  28. package/src/script/index.js +8 -8
  29. package/src/script/publish.js +72 -51
  30. package/src/timer/create.js +29 -29
  31. package/src/timer/index.js +8 -8
  32. package/src/timer/publish.js +47 -47
  33. package/src/token/get.js +11 -11
  34. package/src/token/index.js +7 -7
  35. package/src/triggers/create.js +39 -39
  36. package/src/triggers/index.js +8 -8
  37. package/src/triggers/publish.js +53 -53
  38. package/template/Appvue +24 -24
  39. package/template/babelconfigjs +5 -5
  40. package/template/demojava +14 -14
  41. package/template/gitignore +13 -13
  42. package/template/index.js +57 -57
  43. package/template/indexhtml +21 -21
  44. package/template/indexvue +29 -29
  45. package/template/javaconfigjson +2 -2
  46. package/template/mainjs +13 -13
  47. package/template/package-lockjson +13952 -13952
  48. package/template/packagejson +42 -42
  49. package/template/vueconfigjs +21 -21
  50. package/tool/branch/index.js +25 -25
  51. package/tool/checkLange/checkLang.js +68 -68
  52. package/tool/checkLange/clearLang.js +85 -85
  53. package/utils/cache.js +31 -31
  54. package/utils/checkVersion.js +107 -107
  55. package/utils/config.js +18 -18
  56. package/utils/http.js +123 -123
  57. package/utils/utils.js +95 -95
package/bin/cc.js CHANGED
@@ -1,51 +1,51 @@
1
1
  #!/usr/bin/env node
2
- const chalk = require("chalk")
3
-
4
- let argvs = process.argv.splice(2);
5
-
6
- let action = argvs[0]
7
- if (!action) {
8
- console.log()
9
- console.log(chalk.yellow("Please see the help documentation"));
10
- console.log()
11
- return;
12
- }
13
-
14
-
15
- let type = argvs[1]
16
- if (!type) {
17
- console.log()
18
- console.log(chalk.yellow("Please see the help documentation"));
19
- console.log()
20
- return;
21
- }
22
-
23
- const cc = {}
24
-
25
- cc.project = require("../src/project/index")
26
-
27
- cc.plugin = require("../src/plugin/index")
28
-
29
- cc.classes = require("../src/classes/index")
30
-
31
- cc.schedule = require("../src/timer/index")
32
-
33
- cc.triggers = require("../src/triggers/index")
34
- cc.timer = require("../src/timer/index")
35
-
36
- cc.script = require("../src/script/index")
37
-
38
- cc.token = require("../src/token/index")
39
-
40
- cc.object = require("../src/object/index")
41
-
42
- cc.recordType = require("../src/recordType/index")
43
-
44
- cc.config = require("../src/config/index")
45
- try {
46
- cc[argvs[1]](argvs[0], argvs);
47
- } catch (e) {
48
- console.log()
49
- console.log(chalk.yellow("Please see the help documentation"), e);
50
- console.log()
2
+ const chalk = require("chalk")
3
+
4
+ let argvs = process.argv.splice(2);
5
+
6
+ let action = argvs[0]
7
+ if (!action) {
8
+ console.log()
9
+ console.log(chalk.yellow("Please see the help documentation"));
10
+ console.log()
11
+ return;
12
+ }
13
+
14
+
15
+ let type = argvs[1]
16
+ if (!type) {
17
+ console.log()
18
+ console.log(chalk.yellow("Please see the help documentation"));
19
+ console.log()
20
+ return;
21
+ }
22
+
23
+ const cc = {}
24
+
25
+ cc.project = require("../src/project/index")
26
+
27
+ cc.plugin = require("../src/plugin/index")
28
+
29
+ cc.classes = require("../src/classes/index")
30
+
31
+ cc.schedule = require("../src/timer/index")
32
+
33
+ cc.triggers = require("../src/triggers/index")
34
+ cc.timer = require("../src/timer/index")
35
+
36
+ cc.script = require("../src/script/index")
37
+
38
+ cc.token = require("../src/token/index")
39
+
40
+ cc.object = require("../src/object/index")
41
+
42
+ cc.recordType = require("../src/recordType/index")
43
+
44
+ cc.config = require("../src/config/index")
45
+ try {
46
+ cc[argvs[1]](argvs[0], argvs);
47
+ } catch (e) {
48
+ console.log()
49
+ console.log(chalk.yellow("Please see the help documentation"), e);
50
+ console.log()
51
51
  }
package/bin/plugin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
-
3
- const Builder = require("../src/plugin/publish.js");
4
-
5
- const builder = new Builder();
6
-
2
+
3
+ const Builder = require("../src/plugin/publish.js");
4
+
5
+ const builder = new Builder();
6
+
7
7
  builder.init();
package/bin/project.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
-
3
- const Create = require("../src/project/create.js");
4
-
5
- const project = new Create();
6
-
2
+
3
+ const Create = require("../src/project/create.js");
4
+
5
+ const project = new Create();
6
+
7
7
  project.init();
@@ -1,35 +1,35 @@
1
- package com.cloudcc.core;
2
-
3
- import com.alibaba.fastjson.JSONObject;
4
-
5
- import java.util.HashMap;
6
-
7
- public class ServiceResult extends HashMap {
8
- public String success;
9
- public String message;
10
- public String Id;
11
-
12
- public void addErrorMessage(String msg) throws Exception{
13
- this.put("message",msg);
14
- this.put("success","false");
15
- throw new Exception(msg);
16
- }
17
-
18
- public String getMessage(){
19
- return (String)this.get("message");
20
- }
21
-
22
- public String getSuccess(){
23
- return (String)this.get("success");
24
- }
25
- public String getId(){
26
- return (String)this.get("id");
27
- }
28
-
29
- @Override
30
- public String toString(){
31
- JSONObject data = new JSONObject();
32
- data.putAll(this);
33
- return data.toString();
34
- }
35
- }
1
+ package com.cloudcc.core;
2
+
3
+ import com.alibaba.fastjson.JSONObject;
4
+
5
+ import java.util.HashMap;
6
+
7
+ public class ServiceResult extends HashMap {
8
+ public String success;
9
+ public String message;
10
+ public String Id;
11
+
12
+ public void addErrorMessage(String msg) throws Exception{
13
+ this.put("message",msg);
14
+ this.put("success","false");
15
+ throw new Exception(msg);
16
+ }
17
+
18
+ public String getMessage(){
19
+ return (String)this.get("message");
20
+ }
21
+
22
+ public String getSuccess(){
23
+ return (String)this.get("success");
24
+ }
25
+ public String getId(){
26
+ return (String)this.get("id");
27
+ }
28
+
29
+ @Override
30
+ public String toString(){
31
+ JSONObject data = new JSONObject();
32
+ data.putAll(this);
33
+ return data.toString();
34
+ }
35
+ }
@@ -1,45 +1,45 @@
1
- package com.cloudcc.core;
2
-
3
- import com.cloudcc.core.CCObject;
4
-
5
- public class UserInfo extends CCObject{
6
- public String binding;
7
- public String getUserId() {
8
- return (String)this.get("id");
9
- }
10
-
11
- public String getRoleId() {
12
- return (String)this.get("role");
13
- }
14
-
15
- public UserInfo (String username,String pwd) throws Exception {
16
- this.put("userName", username);
17
- this.put("password", pwd);
18
- }
19
-
20
- public UserInfo() {
21
-
22
- }
23
-
24
- public String getLoginName(){
25
- return (String)this.get("userName");
26
- }
27
- public String getProfileId() {
28
- // TODO Auto-generated method stub
29
- return (String)this.get("profileId");
30
- }
31
- public void setBinding(String bind){
32
- this.binding = bind;
33
- this.put("binding",bind);
34
- }
35
- public String getBinding(){
36
- if (this.binding == null){
37
- return (String)this.get("binding");
38
- } else {
39
- return this.binding;
40
- }
41
- }
42
- public String getUserName() {
43
- return (String)this.get("name");
44
- }
45
- }
1
+ package com.cloudcc.core;
2
+
3
+ import com.cloudcc.core.CCObject;
4
+
5
+ public class UserInfo extends CCObject{
6
+ public String binding;
7
+ public String getUserId() {
8
+ return (String)this.get("id");
9
+ }
10
+
11
+ public String getRoleId() {
12
+ return (String)this.get("role");
13
+ }
14
+
15
+ public UserInfo (String username,String pwd) throws Exception {
16
+ this.put("userName", username);
17
+ this.put("password", pwd);
18
+ }
19
+
20
+ public UserInfo() {
21
+
22
+ }
23
+
24
+ public String getLoginName(){
25
+ return (String)this.get("userName");
26
+ }
27
+ public String getProfileId() {
28
+ // TODO Auto-generated method stub
29
+ return (String)this.get("profileId");
30
+ }
31
+ public void setBinding(String bind){
32
+ this.binding = bind;
33
+ this.put("binding",bind);
34
+ }
35
+ public String getBinding(){
36
+ if (this.binding == null){
37
+ return (String)this.get("binding");
38
+ } else {
39
+ return this.binding;
40
+ }
41
+ }
42
+ public String getUserName() {
43
+ return (String)this.get("name");
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "cloudcc-cli",
3
- "version": "1.8.7",
4
- "description": "cloudcc-cli",
5
- "keywords": [
6
- "cloudcc",
7
- "cloudcc-cli"
8
- ],
9
- "main": "./bin",
10
- "author": "cloudcc",
11
- "license": "ISC",
12
- "bin": {
13
- "cloudccCreate": "bin/project.js",
14
- "cloudccBuild": "bin/plugin.js",
15
- "cc": "bin/cc.js"
16
- },
17
- "scripts": {
18
- "cc-pull": "git fetch --tags -f && git pull",
19
- "publish-lib": "npm publish --registry https://registry.npmjs.org && git add . && git commit -m 'update version' && git push && curl https://npmmirror.com/sync/cloudcc-cli"
20
- },
21
- "dependencies": {
22
- "axios": "^0.21.4",
23
- "boxen": "^4.0.0",
24
- "chalk": "^2.4.2",
25
- "crypto-js": "^4.1.1",
26
- "dayjs": "^1.10.7",
27
- "fs-extra": "^11.2.0",
28
- "inquirer": "^8.1.0",
29
- "marked": "^5.0.1",
30
- "mem-fs": "^2.2.1",
31
- "mem-fs-editor": "^9.0.1",
32
- "vue-custom-element": "^3.3.0",
33
- "vue-template-compiler": "^2.6.14"
34
- }
1
+ {
2
+ "name": "cloudcc-cli",
3
+ "version": "1.8.8",
4
+ "description": "cloudcc-cli",
5
+ "keywords": [
6
+ "cloudcc",
7
+ "cloudcc-cli"
8
+ ],
9
+ "main": "./bin",
10
+ "author": "cloudcc",
11
+ "license": "ISC",
12
+ "bin": {
13
+ "cloudccCreate": "bin/project.js",
14
+ "cloudccBuild": "bin/plugin.js",
15
+ "cc": "bin/cc.js"
16
+ },
17
+ "scripts": {
18
+ "cc-pull": "git fetch --tags -f && git pull",
19
+ "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
+ },
21
+ "dependencies": {
22
+ "axios": "^0.21.4",
23
+ "boxen": "^4.0.0",
24
+ "chalk": "^2.4.2",
25
+ "crypto-js": "^4.1.1",
26
+ "dayjs": "^1.10.7",
27
+ "fs-extra": "^11.2.0",
28
+ "inquirer": "^8.1.0",
29
+ "marked": "^5.0.1",
30
+ "mem-fs": "^2.2.1",
31
+ "mem-fs-editor": "^9.0.1",
32
+ "vue-custom-element": "^3.3.0",
33
+ "vue-template-compiler": "^2.6.14"
34
+ }
35
35
  }
@@ -1,43 +1,43 @@
1
- const { checkUpdate } = require("../../utils/checkVersion")
2
- const fs = require("fs");
3
- const path = require("path")
4
- const chalk = require("chalk")
5
- const { getPackageJson } = require("../../utils/config.js")
6
-
7
- async function create(name) {
8
- let res = await checkUpdate();
9
- if (!res) {
10
- const classesPath = path.join(process.cwd(), "classes/" + name);
11
- try {
12
- fs.mkdirSync(classesPath, { recursive: true })
13
- const javaTmp =
14
- `// @SOURCE_CONTENT_START
15
- public class ${name}{
16
- private UserInfo userInfo;
17
-
18
- public ${name}(UserInfo userInfo){
19
- this.userInfo = userInfo;
20
- }
21
-
22
-
23
- public String demo(String str){
24
- str = "demo";
25
- return str;
26
- }
27
- }
28
- // @SOURCE_CONTENT_END
29
- `
30
- fs.writeFileSync(path.join(classesPath, name + ".java"), javaTmp)
31
- fs.writeFileSync(path.join(classesPath, "config.json"), `{"name":"${name}","version":"${getPackageJson().extandVersion || '2'}"}`)
32
- console.log()
33
- console.log(chalk.green("Successfully Created:" + name))
34
- console.log()
35
- } catch (e) {
36
- console.log()
37
- console.log(chalk.red("Creation Failed:" + e))
38
- console.log()
39
- }
40
- }
41
- }
42
-
43
- module.exports = create;
1
+ const { checkUpdate } = require("../../utils/checkVersion")
2
+ const fs = require("fs");
3
+ const path = require("path")
4
+ const chalk = require("chalk")
5
+ const { getPackageJson } = require("../../utils/config.js")
6
+
7
+ async function create(name) {
8
+ let res = await checkUpdate();
9
+ if (!res) {
10
+ const classesPath = path.join(process.cwd(), "classes/" + name);
11
+ try {
12
+ fs.mkdirSync(classesPath, { recursive: true })
13
+ const javaTmp =
14
+ `// @SOURCE_CONTENT_START
15
+ public class ${name}{
16
+ private UserInfo userInfo;
17
+
18
+ public ${name}(UserInfo userInfo){
19
+ this.userInfo = userInfo;
20
+ }
21
+
22
+
23
+ public String demo(String str){
24
+ str = "demo";
25
+ return str;
26
+ }
27
+ }
28
+ // @SOURCE_CONTENT_END
29
+ `
30
+ fs.writeFileSync(path.join(classesPath, name + ".java"), javaTmp)
31
+ fs.writeFileSync(path.join(classesPath, "config.json"), `{"name":"${name}","version":"${getPackageJson().extandVersion || '2'}"}`)
32
+ console.log()
33
+ console.log(chalk.green("Successfully Created:" + name))
34
+ console.log()
35
+ } catch (e) {
36
+ console.log()
37
+ console.log(chalk.red("Creation Failed:" + e))
38
+ console.log()
39
+ }
40
+ }
41
+ }
42
+
43
+ module.exports = create;
@@ -1,8 +1,8 @@
1
- const cc = {}
2
- cc.create = require("./create")
3
- cc.publish = require("./publish")
4
- function Classes(action, argvs) {
5
- cc[action](argvs[2])
6
- }
7
-
8
- module.exports = Classes;
1
+ const cc = {}
2
+ cc.create = require("./create")
3
+ cc.publish = require("./publish")
4
+ function Classes(action, argvs) {
5
+ cc[action](argvs[2])
6
+ }
7
+
8
+ module.exports = Classes;
@@ -1,45 +1,45 @@
1
- const { checkUpdate } = require("../../utils/checkVersion")
2
- const fs = require("fs");
3
- const path = require("path")
4
- const chalk = require("chalk")
5
- const { postNormal } = require("../../utils/http")
6
-
7
- const { getBusToken } = require("../../utils/utils")
8
-
9
- async function publish(name) {
10
- let res = await checkUpdate();
11
- if (!res) {
12
- console.log();
13
- console.log(chalk.green('Posting, please wait...'));
14
- console.log();
15
- const classPath = path.join(process.cwd(), `classes/${name}/`);
16
- let fullContent = fs.readFileSync(classPath + `${name}.java`, 'utf8');
17
-
18
- const sourceMatch = fullContent.match(/\/\/ @SOURCE_CONTENT_START\n([\s\S]*?)\n\/\/ @SOURCE_CONTENT_END/);
19
- let classContent = sourceMatch ? sourceMatch[1] : fullContent;
20
- let configContent = JSON.parse(fs.readFileSync(classPath + "config.json", 'utf8'));
21
-
22
- if (await getBusToken()) {
23
- let body = {
24
- "id": configContent.id,
25
- "name": name,
26
- "source": encodeURIComponent(classContent),
27
- "version": configContent.version || "2",
28
- "folderId": "wgd"
29
- }
30
- let res = await postNormal(global.setupSvc + "/api/ccfag/save", body)
31
- if (res.result) {
32
- console.log(chalk.green('Success!'));
33
- console.log();
34
-
35
- if (!configContent.id) {
36
- configContent.id = res.data
37
- fs.writeFileSync(path.join(classPath, "config.json"), JSON.stringify(configContent))
38
- }
39
- } else {
40
- console.log(chalk.red('Fail:' + res.returnInfo));
41
- }
42
- }
43
- }
44
- }
45
- module.exports = publish;
1
+ const { checkUpdate } = require("../../utils/checkVersion")
2
+ const fs = require("fs");
3
+ const path = require("path")
4
+ const chalk = require("chalk")
5
+ const { postNormal } = require("../../utils/http")
6
+
7
+ const { getBusToken } = require("../../utils/utils")
8
+
9
+ async function publish(name) {
10
+ let res = await checkUpdate();
11
+ if (!res) {
12
+ console.log();
13
+ console.log(chalk.green('Posting, please wait...'));
14
+ console.log();
15
+ const classPath = path.join(process.cwd(), `classes/${name}/`);
16
+ let fullContent = fs.readFileSync(classPath + `${name}.java`, 'utf8');
17
+
18
+ const sourceMatch = fullContent.match(/\/\/ @SOURCE_CONTENT_START\n([\s\S]*?)\n\/\/ @SOURCE_CONTENT_END/);
19
+ let classContent = sourceMatch ? sourceMatch[1] : fullContent;
20
+ let configContent = JSON.parse(fs.readFileSync(classPath + "config.json", 'utf8'));
21
+
22
+ if (await getBusToken()) {
23
+ let body = {
24
+ "id": configContent.id,
25
+ "name": name,
26
+ "source": encodeURIComponent(classContent),
27
+ "version": configContent.version || "2",
28
+ "folderId": "wgd"
29
+ }
30
+ let res = await postNormal(global.setupSvc + "/api/ccfag/save", body)
31
+ if (res.result) {
32
+ console.log(chalk.green('Success!'));
33
+ console.log();
34
+
35
+ if (!configContent.id) {
36
+ configContent.id = res.data
37
+ fs.writeFileSync(path.join(classPath, "config.json"), JSON.stringify(configContent))
38
+ }
39
+ } else {
40
+ console.log(chalk.red('Fail:' + res.returnInfo));
41
+ }
42
+ }
43
+ }
44
+ }
45
+ module.exports = publish;
package/src/config/get.js CHANGED
@@ -1,20 +1,20 @@
1
-
2
- const chalk = require("chalk")
3
- const path = require("path")
4
-
5
- async function get(projectPath = process.cwd()) {
6
- let config = require(path.join(projectPath, "cloudcc-cli.config.js"))
7
- if (config) {
8
- console.log();
9
- Object.keys(config).map((item) => {
10
- if (item == config.use) {
11
- console.log(chalk.green(`*${item}`));
12
- } else if ("use" != item) {
13
- console.log(item);
14
- }
15
- })
16
- console.log();
17
- }
18
- }
19
-
20
- module.exports = get;
1
+
2
+ const chalk = require("chalk")
3
+ const path = require("path")
4
+
5
+ async function get(projectPath = process.cwd()) {
6
+ let config = require(path.join(projectPath, "cloudcc-cli.config.js"))
7
+ if (config) {
8
+ console.log();
9
+ Object.keys(config).map((item) => {
10
+ if (item == config.use) {
11
+ console.log(chalk.green(`*${item}`));
12
+ } else if ("use" != item) {
13
+ console.log(item);
14
+ }
15
+ })
16
+ console.log();
17
+ }
18
+ }
19
+
20
+ module.exports = get;
@@ -1,8 +1,8 @@
1
- const cc = {}
2
- cc.use = require("./use")
3
- cc.get = require("./get")
4
- function main(action, argvs) {
5
- cc[action](argvs[2], argvs[3])
6
- }
7
-
8
- module.exports = main;
1
+ const cc = {}
2
+ cc.use = require("./use")
3
+ cc.get = require("./get")
4
+ function main(action, argvs) {
5
+ cc[action](argvs[2], argvs[3])
6
+ }
7
+
8
+ module.exports = main;
package/src/config/use.js CHANGED
@@ -1,14 +1,14 @@
1
- const path = require("path")
2
- const fs = require("fs")
3
-
4
- function use(env, projectPath = process.cwd()) {
5
- let config = require(path.join(projectPath, "cloudcc-cli.config.js"));
6
- config.use = env;
7
- fs.writeFileSync(path.join(projectPath, "cloudcc-cli.config.js"),
8
- `module.exports =
9
- ${JSON.stringify(config)}
10
- `
11
- , 'utf8');
12
- }
13
-
14
- module.exports = use;
1
+ const path = require("path")
2
+ const fs = require("fs")
3
+
4
+ function use(env, projectPath = process.cwd()) {
5
+ let config = require(path.join(projectPath, "cloudcc-cli.config.js"));
6
+ config.use = env;
7
+ fs.writeFileSync(path.join(projectPath, "cloudcc-cli.config.js"),
8
+ `module.exports =
9
+ ${JSON.stringify(config)}
10
+ `
11
+ , 'utf8');
12
+ }
13
+
14
+ module.exports = use;