@cnbcool/cnb-api-generate 1.2.1 → 1.2.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.
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getGenerateLicense = getGenerateLicense;
4
4
  exports.getApiGenerateLicense = getApiGenerateLicense;
5
- const fs_1 = require("fs");
6
- const path_1 = require("path");
7
- const pkg = JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../../package.json'), 'utf8'));
8
5
  function getGenerateLicense({ source }) {
9
6
  return `// @ts-nocheck
10
7
  /* tslint:disable */
@@ -14,9 +11,8 @@ function getGenerateLicense({ source }) {
14
11
  * ## THIS FILE WAS GENERATED VIA CNB-API-GENERATE ##
15
12
  * ## ##
16
13
  * ## AUTHOR: bapelin ##
17
- * ## SOURCE: https://cnb.cool/cnb/frontend-science/cnb-api-generate ##
14
+ * ## SOURCE: https://cnb.cool/cnb/skills/cnb-api-generate ##
18
15
  * -------------------------------------------------------------------------
19
- * @Version ${pkg.version}
20
16
  * @Source ${source}
21
17
  */
22
18
  `;
@@ -30,9 +26,8 @@ function getApiGenerateLicense({ source }) {
30
26
  * ## THIS FILE WAS GENERATED VIA CNB-API-GENERATE ##
31
27
  * ## ##
32
28
  * ## AUTHOR: bapelin ##
33
- * ## SOURCE: https://cnb.cool/cnb/frontend-science/cnb-api-generate ##
29
+ * ## SOURCE: https://cnb.cool/cnb/skills/cnb-api-generate ##
34
30
  * -------------------------------------------------------------------------
35
- * @Version ${pkg.version}
36
31
  * @Source ${source}
37
32
  */
38
33
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -7,16 +7,22 @@ description: CNB OpenAPI 交互能力,支持仓库、Issue、PR、流水线、
7
7
 
8
8
  操作 CNB 平台资源的 CLI 工具。
9
9
 
10
- ## 快捷命令(优先使用,path 参数自动注入)
10
+ ## 快捷命令(优先使用)
11
11
 
12
- Issue 模块: get, list-comments, comment, close, open, list-labels, add-labels, list-assignees, add-assignees
13
- PR 模块: get, list-files, list-commits, list-comments, comment, list-labels, add-labels, check-status, list-reviews, list-assignees
12
+ issues 模块: get, list-comments, comment, close, open, list-labels, add-labels, list-assignees, add-assignees
13
+ pulls 模块: get, list-files, list-commits, list-comments, comment, list-labels, add-labels, check-status, list-reviews, list-assignees
14
14
 
15
- 用法: `<$CNB_CLI_CMD$> issues get`参数均从环境变量自动获取,无需手动传入
15
+ 用法: `<$CNB_CLI_CMD$> <module> <command>`路径参数已从环境变量自动注入,**禁止传入编号、slug 等位置参数**。
16
+ - ✅ `<$CNB_CLI_CMD$> issues get --summary` / `<$CNB_CLI_CMD$> issues list-comments`
17
+ - ✅ `<$CNB_CLI_CMD$> pulls get --summary` / `<$CNB_CLI_CMD$> pulls list-comments`
18
+
19
+ **仅需要获取摘要信息时加 --summary**,减少输出噪音:
20
+ - issues: get, close, open, add-assignees
21
+ - pulls: get, list-files, list-commits
16
22
 
17
23
  仅以下命令需要 --data,其余快捷命令无需任何参数:
18
- - comment: --data '{"body":"评论内容"}'
19
- - add-labels: --data '{"labels":["标签名"]}'
24
+ - comment: --data '{"body":"内容"}'
25
+ - add-labels: --data '{"labels":["标签"]}'
20
26
  - add-assignees(仅Issue): --data '{"assignees":["用户名"]}'
21
27
 
22
28
  ## 其他 API(快捷命令不满足时使用)