cloudcc-cli 1.6.4 → 1.6.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 (67) hide show
  1. package/README.md +1176 -1161
  2. package/bin/cc.js +49 -49
  3. package/bin/plugin.js +6 -6
  4. package/bin/project.js +6 -6
  5. package/core/core/CCObject.java +48 -0
  6. package/core/core/CCService.java +806 -0
  7. package/core/core/CCTrigger.java +23 -0
  8. package/core/core/CCTriggerHandler.java +15 -0
  9. package/core/core/DevLogger.java +39 -0
  10. package/core/core/OperatationEnum.java +5 -0
  11. package/core/core/PeakInterf.java +6 -0
  12. package/core/core/PeakSvc.java +8 -0
  13. package/core/core/ServiceResult.java +35 -0
  14. package/core/core/TriggerInvoker.java +83 -0
  15. package/core/core/TriggerMethod.java +9 -0
  16. package/core/core/TriggerTimeEnum.java +5 -0
  17. package/core/core/UserInfo.java +45 -0
  18. package/core.zip +0 -0
  19. package/package.json +34 -34
  20. package/src/classes/create.js +40 -43
  21. package/src/classes/index.js +8 -8
  22. package/src/classes/publish.js +43 -47
  23. package/src/config/get.js +20 -22
  24. package/src/config/index.js +8 -8
  25. package/src/config/use.js +14 -16
  26. package/src/object/get.js +14 -16
  27. package/src/object/index.js +7 -7
  28. package/src/plugin/create.js +70 -80
  29. package/src/plugin/create1.js +58 -66
  30. package/src/plugin/index.js +8 -8
  31. package/src/plugin/publish.js +265 -298
  32. package/src/plugin/publish1.js +256 -286
  33. package/src/project/create.js +87 -89
  34. package/src/project/create1.js +109 -111
  35. package/src/project/index.js +7 -7
  36. package/src/recordType/get.js +13 -16
  37. package/src/recordType/index.js +7 -7
  38. package/src/script/create.js +29 -32
  39. package/src/script/index.js +8 -8
  40. package/src/script/publish.js +62 -69
  41. package/src/timer/create.js +26 -29
  42. package/src/timer/index.js +8 -8
  43. package/src/timer/publish.js +43 -47
  44. package/src/token/get.js +11 -13
  45. package/src/token/index.js +7 -7
  46. package/src/triggers/create.js +27 -35
  47. package/src/triggers/index.js +8 -8
  48. package/src/triggers/publish.js +48 -51
  49. package/template/Appvue +29 -29
  50. package/template/babelconfigjs +5 -5
  51. package/template/demojava +14 -14
  52. package/template/gitignore +11 -11
  53. package/template/index.js +57 -57
  54. package/template/indexhtml +21 -21
  55. package/template/indexvue +34 -34
  56. package/template/javaconfigjson +2 -2
  57. package/template/mainjs +13 -13
  58. package/template/package-lockjson +12115 -12115
  59. package/template/packagejson +42 -42
  60. package/template/vueconfigjs +26 -26
  61. package/tool/branch/index.js +25 -0
  62. package/tool/checkLange/checkLang.js +68 -0
  63. package/tool/checkLange/clearLang.js +85 -0
  64. package/tool/checkLange/result.txt +0 -0
  65. package/utils/checkVersion.js +94 -105
  66. package/utils/http.js +122 -122
  67. package/utils/utils.js +57 -59
package/src/object/get.js CHANGED
@@ -1,16 +1,14 @@
1
- const { getBusToken } = require("../../utils/utils")
2
- const { postNormal } = require("../../utils/http")
3
- /**
4
- * 获取对象集合
5
- */
6
- async function get(path = process.cwd()) {
7
- // 获取token成功后,发布内容
8
- if (await getBusToken(path)) {
9
- let url = new URL(global.baseUrl).origin
10
- let res = await postNormal(url + "/setup/api/customObject/standardObjList")
11
- console.log(JSON.stringify(res.data))
12
- return res.data
13
- }
14
- }
15
-
16
- module.exports = get;
1
+ const { getBusToken } = require("../../utils/utils")
2
+ const { postNormal } = require("../../utils/http")
3
+
4
+
5
+ async function get(path = process.cwd()) {
6
+
7
+ if (await getBusToken(path)) {
8
+ let res = await postNormal(global.setupSvc + "/api/customObject/standardObjList")
9
+ console.log(JSON.stringify(res.data))
10
+ return res.data
11
+ }
12
+ }
13
+
14
+ module.exports = get;
@@ -1,7 +1,7 @@
1
- const cc = {}
2
- cc.get = require("./get")
3
- function main(action, argvs) {
4
- cc[action](argvs[2])
5
- }
6
-
7
- module.exports = main;
1
+ const cc = {}
2
+ cc.get = require("./get")
3
+ function main(action, argvs) {
4
+ cc[action](argvs[2])
5
+ }
6
+
7
+ module.exports = main;
@@ -1,80 +1,70 @@
1
- const fs = require('fs');
2
- const inquirer = require("inquirer")
3
- // 检查cli版本更新功能
4
- const { checkUpdate } = require("../../utils/checkVersion")
5
- const temp = `<template>
6
- <div class="cc-container">
7
- <div>Hello CloudCC</div>
8
- <div>
9
- <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
10
- 开发者文档</a
11
- >
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- data() {
19
- return {
20
- componentInfo: {
21
- // 组件唯一标识,全局唯一
22
- component: "cloudcc-demo-01",
23
- // 组件名称,在页面编辑器显示的名字
24
- compName: "cloudcc-demo-01",
25
- // 组件描述信息
26
- compDesc: "组件描述信息",
27
- },
28
- isLock: false,
29
- };
30
- },
31
- };
32
- </script>
33
- <style lang="scss" scoped>
34
- .cc-container {
35
- text-align: center;
36
- padding: 8px;
37
- background: goldenrod;
38
- }
39
- </style>`
40
- /**
41
- * 创建组件模板文件
42
- */
43
- class Builder {
44
- constructor() {
45
- this.options = {
46
- // 开发配置信息
47
- devConsoleConfig: {
48
- },
49
- }
50
- this.plugin = process.argv.splice(2)[0]
51
- }
52
- async init() {
53
- let res = await checkUpdate();
54
- if (!res) {
55
- // 获得用户输入
56
- let answers;
57
- if (this.plugin) {
58
- answers = { buildFileName: this.plugin + "/demo.vue" }
59
- } else {
60
- answers = await this.ask();
61
- answers.buildFileName = "./plugin/" + answers.buildFileName
62
- }
63
- fs.writeFileSync(answers.buildFileName, temp);
64
- }
65
- }
66
- /**
67
- * 命令行交互
68
- * @returns 结果
69
- */
70
- ask() {
71
- const prompt = [];
72
- prompt.push({
73
- type: "input",
74
- name: "buildFileName",
75
- message: "请输入文件名,如index.vue",
76
- })
77
- return inquirer.prompt(prompt)
78
- }
79
- }
80
- module.exports = Builder;
1
+ const fs = require('fs');
2
+ const inquirer = require("inquirer")
3
+
4
+ const { checkUpdate } = require("../../utils/checkVersion")
5
+ const temp = `<template>
6
+ <div class="cc-container">
7
+ <div>Hello CloudCC</div>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ export default {
13
+ data() {
14
+ return {
15
+ componentInfo: {
16
+
17
+ component: "cloudcc-demo-01",
18
+
19
+ compName: "cloudcc-demo-01",
20
+
21
+ compDesc: "Component description information",
22
+ },
23
+ isLock: false,
24
+ };
25
+ },
26
+ };
27
+ </script>
28
+ <style lang="scss" scoped>
29
+ .cc-container {
30
+ text-align: center;
31
+ padding: 8px;
32
+ background: goldenrod;
33
+ }
34
+ </style>`
35
+
36
+ class Builder {
37
+ constructor() {
38
+ this.options = {
39
+
40
+ devConsoleConfig: {
41
+ },
42
+ }
43
+ this.plugin = process.argv.splice(2)[0]
44
+ }
45
+ async init() {
46
+ let res = await checkUpdate();
47
+ if (!res) {
48
+
49
+ let answers;
50
+ if (this.plugin) {
51
+ answers = { buildFileName: this.plugin + "/demo.vue" }
52
+ } else {
53
+ answers = await this.ask();
54
+ answers.buildFileName = "./plugin/" + answers.buildFileName
55
+ }
56
+ fs.writeFileSync(answers.buildFileName, temp);
57
+ }
58
+ }
59
+
60
+ ask() {
61
+ const prompt = [];
62
+ prompt.push({
63
+ type: "input",
64
+ name: "buildFileName",
65
+ message: "Please enter a file name, such as index.vue",
66
+ })
67
+ return inquirer.prompt(prompt)
68
+ }
69
+ }
70
+ module.exports = Builder;
@@ -1,66 +1,58 @@
1
- // 检查cli版本更新功能
2
- const { checkUpdate } = require("../../utils/checkVersion")
3
- const fs = require("fs");
4
- const path = require("path")
5
- const chalk = require("chalk")
6
-
7
-
8
- /**
9
- * 创建文件
10
- * @param {string} name 文件名称
11
- */
12
- async function create(name) {
13
- const temp = `<template>
14
- <div class="cc-container">
15
- <div>Hello CloudCC</div>
16
- <div>
17
- <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
18
- 开发者文档</a
19
- >
20
- </div>
21
- </div>
22
- </template>
23
-
24
- <script>
25
- export default {
26
- data() {
27
- return {
28
- componentInfo: {
29
- // 组件唯一标识,全局唯一
30
- component: "${name}",
31
- // 组件名称,在页面编辑器显示的名字
32
- compName: "${name}",
33
- // 组件描述信息
34
- compDesc: "组件描述信息",
35
- },
36
- isLock: false,
37
- };
38
- },
39
- };
40
- </script>
41
- <style lang="scss" scoped>
42
- .cc-container {
43
- text-align: center;
44
- padding: 8px;
45
- background: goldenrod;
46
- }
47
- </style>`
48
- let res = await checkUpdate();
49
- if (!res) {
50
-
51
- const pluginPath = path.join(process.cwd(), "plugin/" + name);
52
- try {
53
- fs.mkdirSync(pluginPath, { recursive: true })
54
- fs.writeFileSync(path.join(pluginPath, name + ".vue"), temp)
55
- fs.writeFileSync(path.join(pluginPath, "config.json"), `{"name":"${name}"}`)
56
- console.log()
57
- console.log(chalk.green("创建成功:" + name))
58
- console.log()
59
- } catch (e) {
60
- console.log()
61
- console.log(chalk.red("创建失败:" + e))
62
- console.log()
63
- }
64
- }
65
- }
66
- module.exports = create;
1
+
2
+ const { checkUpdate } = require("../../utils/checkVersion")
3
+ const fs = require("fs");
4
+ const path = require("path")
5
+ const chalk = require("chalk")
6
+
7
+
8
+
9
+ async function create(name) {
10
+ const temp = `<template>
11
+ <div class="cc-container">
12
+ <div>Hello CloudCC</div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ data() {
19
+ return {
20
+ componentInfo: {
21
+
22
+ component: "${name}",
23
+
24
+ compName: "${name}",
25
+
26
+ compDesc: "Component description information",
27
+ },
28
+ isLock: false,
29
+ };
30
+ },
31
+ };
32
+ </script>
33
+ <style lang="scss" scoped>
34
+ .cc-container {
35
+ text-align: center;
36
+ padding: 8px;
37
+ background: goldenrod;
38
+ }
39
+ </style>`
40
+ let res = await checkUpdate();
41
+ if (!res) {
42
+
43
+ const pluginPath = path.join(process.cwd(), "plugins/" + name);
44
+ try {
45
+ fs.mkdirSync(pluginPath, { recursive: true })
46
+ fs.writeFileSync(path.join(pluginPath, name + ".vue"), temp)
47
+ fs.writeFileSync(path.join(pluginPath, "config.json"), `{"name":"${name}"}`)
48
+ console.log()
49
+ console.log(chalk.green("Successfully Created:" + name))
50
+ console.log()
51
+ } catch (e) {
52
+ console.log()
53
+ console.log(chalk.red("Creation Failed:" + e))
54
+ console.log()
55
+ }
56
+ }
57
+ }
58
+ module.exports = create;
@@ -1,8 +1,8 @@
1
- const cc = {}
2
- cc.create = require("./create1")
3
- cc.publish = require("./publish1")
4
- function Plugin(action, argvs) {
5
- cc[action](argvs[2])
6
- }
7
-
8
- module.exports = Plugin;
1
+ const cc = {}
2
+ cc.create = require("./create1")
3
+ cc.publish = require("./publish1")
4
+ function Plugin(action, argvs) {
5
+ cc[action](argvs[2])
6
+ }
7
+
8
+ module.exports = Plugin;