cloudcc-cli 1.8.1 → 1.8.3

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/README.md CHANGED
@@ -1,3 +1,18 @@
1
+ # ReleaseV1.8.3
2
+ #### Release Date: 2025-1-22
3
+ #### Release Scope: Full
4
+ #### Release Content
5
+ * Optimization
6
+ * Adjust the encoding
7
+
8
+ # ReleaseV1.8.2
9
+ #### Release Date: 2025-1-21
10
+ #### Release Scope: Full
11
+ #### Release Content
12
+ * Optimization
13
+ * Create a project and stop checking the version upgrade。
14
+ * Add custom object search
15
+
1
16
  # ReleaseV1.8.1
2
17
  #### Release Date: 2025-1-21
3
18
  #### Release Scope: Full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "scripts": {
18
18
  "cc-pull": "git fetch --tags -f && git pull",
19
- "publish-lib": "npm publish --registry https://registry.npmjs.org && git add . && git commit -m '发布新版' && git push && curl https://npmmirror.com/sync/cloudcc-cli"
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
20
  },
21
21
  "dependencies": {
22
22
  "axios": "^0.21.4",
@@ -2,6 +2,7 @@ const { checkUpdate } = require("../../utils/checkVersion")
2
2
  const fs = require("fs");
3
3
  const path = require("path")
4
4
  const chalk = require("chalk")
5
+ const { getPackageJson } = require("../../utils/config.js")
5
6
 
6
7
  async function create(name) {
7
8
  let res = await checkUpdate();
@@ -9,8 +10,8 @@ async function create(name) {
9
10
  const classesPath = path.join(process.cwd(), "classes/" + name);
10
11
  try {
11
12
  fs.mkdirSync(classesPath, { recursive: true })
12
- const javaTmp =
13
- `// @SOURCE_CONTENT_START
13
+ const javaTmp =
14
+ `// @SOURCE_CONTENT_START
14
15
  public class ${name}{
15
16
  private UserInfo userInfo;
16
17
 
@@ -27,7 +28,7 @@ public class ${name}{
27
28
  // @SOURCE_CONTENT_END
28
29
  `
29
30
  fs.writeFileSync(path.join(classesPath, name + ".java"), javaTmp)
30
- fs.writeFileSync(path.join(classesPath, "config.json"), `{"name":"${name}","version":"3"}`)
31
+ fs.writeFileSync(path.join(classesPath, "config.json"), `{"name":"${name}","version":"${getPackageJson().extandVersion || '2'}"}`)
31
32
  console.log()
32
33
  console.log(chalk.green("Successfully Created:" + name))
33
34
  console.log()
@@ -23,8 +23,8 @@ async function publish(name) {
23
23
  let body = {
24
24
  "id": configContent.id,
25
25
  "name": name,
26
- "source": encodeURI(classContent),
27
- "version": configContent.version,
26
+ "source": encodeURIComponent(classContent),
27
+ "version": configContent.version || "2",
28
28
  "folderId": "wgd"
29
29
  }
30
30
  let res = await postNormal(global.setupSvc + "/api/ccfag/save", body)
package/src/object/get.js CHANGED
@@ -4,9 +4,16 @@ const { postNormal } = require("../../utils/http")
4
4
 
5
5
  async function get(path) {
6
6
  if (await getBusToken(path)) {
7
- let res = await postNormal(global.setupSvc + "/api/customObject/standardObjList")
8
- console.log(JSON.stringify(res.data))
9
- return res.data
7
+ let res = await postNormal(global.setupSvc + "/api/trigger/newobjtrigger")
8
+ res = res.data.targetObjList.map((item) => {
9
+ return {
10
+ id: item.id,
11
+ objname: item.label,
12
+ objprefix: item.schemetable_name
13
+ }
14
+ })
15
+ console.log(JSON.stringify(res))
16
+ return res
10
17
  }
11
18
  }
12
19
 
@@ -4,7 +4,6 @@ const memFs = require("mem-fs")
4
4
  const memFsEditor = require("mem-fs-editor")
5
5
  const fs = require("fs")
6
6
  const path = require("path")
7
- const { checkUpdate } = require("../../utils/checkVersion")
8
7
 
9
8
  class Creator {
10
9
  constructor() {
@@ -13,31 +12,28 @@ class Creator {
13
12
  name: "",
14
13
  description: ""
15
14
  }
16
-
15
+
17
16
  this.rootPath = path.resolve(__dirname, "../../");
18
-
17
+
19
18
  this.tplDirPath = path.join(this.rootPath, "template");
20
19
  }
21
-
20
+
22
21
  async init(name) {
23
- let res = await checkUpdate();
24
- if (!res) {
25
- console.log()
26
- console.log(chalk.green('Welcome CloudCC-CLI'));
27
- console.log()
28
- if (!name) {
29
- this.ask().then(answers => {
30
- this.options = Object.assign({}, this.options, answers);
31
- console.log(this.options);
32
- this.write();
33
- })
34
- } else {
35
- this.options = { name }
22
+ console.log()
23
+ console.log(chalk.green('Welcome CloudCC-CLI'));
24
+ console.log()
25
+ if (!name) {
26
+ this.ask().then(answers => {
27
+ this.options = Object.assign({}, this.options, answers);
28
+ console.log(this.options);
36
29
  this.write();
37
- }
30
+ })
31
+ } else {
32
+ this.options = { name }
33
+ this.write();
38
34
  }
39
35
  }
40
-
36
+
41
37
  ask() {
42
38
  const prompt = [];
43
39
 
@@ -59,7 +55,7 @@ class Creator {
59
55
  });
60
56
  return inquirer.prompt(prompt)
61
57
  }
62
-
58
+
63
59
  write() {
64
60
  console.log();
65
61
  console.log(chalk.green("Starting construction, please wait"));
@@ -4,7 +4,6 @@ const memFs = require("mem-fs")
4
4
  const memFsEditor = require("mem-fs-editor")
5
5
  const fs = require("fs")
6
6
  const path = require("path")
7
- const { checkUpdate } = require("../../utils/checkVersion")
8
7
  const tplBuilder = require("../../template/index");
9
8
  const execSync = require('child_process').execSync;
10
9
 
@@ -15,31 +14,28 @@ class Creator {
15
14
  name: "",
16
15
  description: ""
17
16
  }
18
-
17
+
19
18
  this.rootPath = path.resolve(__dirname, "../../");
20
-
19
+
21
20
  this.tplDirPath = path.join(this.rootPath, "template");
22
21
  }
23
-
22
+
24
23
  async init(name) {
25
- let res = await checkUpdate();
26
- if (!res) {
27
- console.log()
28
- console.log(chalk.green('Welcome CloudCC-CLI'));
29
- console.log()
30
- if (!name) {
31
- this.ask().then(answers => {
32
- this.options = Object.assign({}, this.options, answers);
33
- console.log(this.options);
34
- this.write();
35
- })
36
- } else {
37
- this.options = { name }
24
+ console.log()
25
+ console.log(chalk.green('Welcome CloudCC-CLI'));
26
+ console.log()
27
+ if (!name) {
28
+ this.ask().then(answers => {
29
+ this.options = Object.assign({}, this.options, answers);
30
+ console.log(this.options);
38
31
  this.write();
39
- }
32
+ })
33
+ } else {
34
+ this.options = { name }
35
+ this.write();
40
36
  }
41
37
  }
42
-
38
+
43
39
  ask() {
44
40
  const prompt = [];
45
41
 
@@ -61,7 +57,7 @@ class Creator {
61
57
  });
62
58
  return inquirer.prompt(prompt)
63
59
  }
64
-
60
+
65
61
  write() {
66
62
  console.log();
67
63
  console.log(chalk.green("Starting construction, please wait"));
@@ -2,6 +2,7 @@ const { checkUpdate } = require("../../utils/checkVersion")
2
2
  const fs = require("fs");
3
3
  const path = require("path")
4
4
  const chalk = require("chalk")
5
+ const { getPackageJson } = require("../../utils/config.js")
5
6
 
6
7
  async function create(name) {
7
8
  let res = await checkUpdate();
@@ -13,7 +14,7 @@ async function create(name) {
13
14
  System.out.print("hello World");
14
15
  // @SOURCE_CONTENT_END`
15
16
  fs.writeFileSync(path.join(timerPath, name + ".java"), javaTmp)
16
- fs.writeFileSync(path.join(timerPath, "config.json"), `{"name":"${name}","version":"3"}`)
17
+ fs.writeFileSync(path.join(timerPath, "config.json"), `{"name":"${name}","version":"${getPackageJson().extandVersion || '2'}"}`)
17
18
  console.log()
18
19
  console.log(chalk.green("Successfully Created:" + name))
19
20
  console.log()
@@ -25,8 +25,8 @@ async function publish(name) {
25
25
  let body = {
26
26
  "id": configContent.id,
27
27
  "name": name,
28
- "version": configContent.version,
29
- "source": encodeURI(classContent),
28
+ "version": configContent.version || "2",
29
+ "source": encodeURIComponent(classContent),
30
30
  "folderId": "wgd"
31
31
  }
32
32
  let res = await postNormal(global.setupSvc + "/api/ccPeak/save", body)
@@ -2,13 +2,14 @@ const { checkUpdate } = require("../../utils/checkVersion")
2
2
  const fs = require("fs");
3
3
  const path = require("path")
4
4
  const chalk = require("chalk")
5
+ const { getPackageJson } = require("../../utils/config.js")
5
6
 
6
7
  async function create(argvs) {
7
8
  let res = await checkUpdate();
8
9
  if (!res) {
9
10
  let body = JSON.parse(decodeURI(argvs[2]))
10
11
  const baseTriggersPath = path.join(process.cwd(), "triggers");
11
- const objectFolderPath = path.join(baseTriggersPath, body.targetObjectId);
12
+ const objectFolderPath = path.join(baseTriggersPath, `${body.schemetableName.toLowerCase()}`);
12
13
  const triggersPath = path.join(objectFolderPath, body.name);
13
14
 
14
15
  try {
@@ -21,6 +22,7 @@ System.out.print("hello World");
21
22
  // @SOURCE_CONTENT_END`
22
23
 
23
24
  fs.writeFileSync(path.join(triggersPath, body.name + ".java"), javaTmp);
25
+ body.version = getPackageJson().extandVersion || "2";
24
26
  fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(body));
25
27
  console.log();
26
28
  console.log(chalk.green("Successfully Created:" + body.name));
@@ -30,8 +30,8 @@ async function publish(argvs) {
30
30
  "targetObjectId": configContent.targetObjectId,
31
31
  "triggerTime": configContent.triggerTime,
32
32
  "name": name,
33
- "version": configContent.version,
34
- "triggerSource": encodeURI(classContent),
33
+ "version": configContent.version || "2",
34
+ "triggerSource": encodeURIComponent(classContent),
35
35
  "folderId": "wgd"
36
36
  }
37
37
  let res = await postNormal(global.setupSvc + "/api/triggerSetup/saveTrigger", body)