cloudcc-cli 2.0.3 → 2.0.5

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,17 @@
1
+ # ReleaseV2.0.5
2
+ #### Release Date: 2025-5-9
3
+ #### Release Scope: Full
4
+ #### Release Content
5
+ * Optimization
6
+ * Optimize the request header and ensure that the source field is included to facilitate source tracking
7
+
8
+ # ReleaseV2.0.4
9
+ #### Release Date: 2025-4-8
10
+ #### Release Scope: Full
11
+ #### Release Content
12
+ * Optimization
13
+ * Optimize the plugin token acquisition logic to ensure that tokens are requested only in non-private versions
14
+
1
15
  # ReleaseV2.0.3
2
16
  #### Release Date: 2025-4-8
3
17
  #### Release Scope: Full
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -27,7 +27,6 @@ class Builder {
27
27
  this.options.devConsoleConfig.CloudCCDev = "";
28
28
  this.options.pluginConfig = JSON.parse(fs.readFileSync(path.join(process.cwd(), `plugins/${name}/config.json`), 'utf8'));
29
29
  let config = this.options.devConsoleConfig
30
-
31
30
  if ("private" != this.options.devConsoleConfig.version) {
32
31
  config = { "accessToken": this.options.devConsoleConfig.pluginToken || await this.getToken(config) };
33
32
  }
@@ -269,13 +268,14 @@ class Builder {
269
268
  }
270
269
 
271
270
  let devSvcDispatch = this.options.devConsoleConfig.devSvcDispatch || '/devconsole'
271
+ header.source = this.options.devConsoleConfig.source || "cloudcc_cli"
272
272
  let res = await post(`${this.options.devConsoleConfig.baseUrl || BaseUrl}${devSvcDispatch}/custom/pc/1.0/post/insertCustomComp`,
273
273
  body, header);
274
274
  if (res.returnCode == 200) {
275
275
  console.error(chalk.green(`Success!`));
276
276
  console.log();
277
277
  } else {
278
- console.error(chalk.red(`Publish Plugin Fail: ${res.returnInfo}`));
278
+ console.error(chalk.red(`Publish Plugin Fail: ${JSON.stringify(res)}`));
279
279
  console.log();
280
280
  }
281
281
  return res;
package/utils/http.js CHANGED
@@ -49,7 +49,7 @@ service.interceptors.response.use(
49
49
  )
50
50
  const formateData = (data, header) => {
51
51
  if (header) {
52
- Object.assign(header, { source: "cloudcc_cli" })
52
+ Object.assign({ source: "cloudcc_cli" }, header)
53
53
  }
54
54
  return {
55
55
  head: {
package/utils/utils.js CHANGED
@@ -94,7 +94,7 @@ async function getBusToken(config) {
94
94
  process.exit(1)
95
95
  }
96
96
  } catch (error) {
97
- console.error(chalk.red(`Get OpenAPI Token Failed:`, error.message));
97
+ console.error(chalk.red(`Get OpenAPI Token Error:`, error.message));
98
98
  process.exit(1)
99
99
  }
100
100
  }
@@ -128,7 +128,9 @@ async function getDevConsoleConfig(projectPath = process.cwd(), config) {
128
128
  config = await getBaseUrl(config);
129
129
  config = await getBusToken(config);
130
130
  config = await getSecretKey(config);
131
- config = await getPluginToken(config);
131
+ if ("private" != config.version) {
132
+ config = await getPluginToken(config);
133
+ }
132
134
  config.timestamp = Date.now();
133
135
  writeCache(projectPath, { [config.safetyMark || config.secretKey]: config })
134
136
  return config;