cloudcc-cli 1.8.2 → 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,10 @@
1
+ # ReleaseV1.8.3
2
+ #### Release Date: 2025-1-22
3
+ #### Release Scope: Full
4
+ #### Release Content
5
+ * Optimization
6
+ * Adjust the encoding
7
+
1
8
  # ReleaseV1.8.2
2
9
  #### Release Date: 2025-1-21
3
10
  #### Release Scope: Full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.8.2",
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)
@@ -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,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(argvs) {
7
8
  let res = await checkUpdate();
@@ -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)