@cnbcool/cnb-cli 1.0.6 → 1.0.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "CNB OpenAPI 命令行工具,基于 CNB 平台 Swagger 自动生成,支持 Issues、PR、Git、组织管理等全部 API 操作",
5
5
  "main": "skills/cnb-api/scripts/core/index.js",
6
6
  "bin": {
@@ -34,7 +34,7 @@
34
34
  "author": "",
35
35
  "license": "MIT",
36
36
  "devDependencies": {
37
- "@cnbcool/cnb-api-generate": "^1.2.3",
37
+ "@cnbcool/cnb-api-generate": "^1.2.4",
38
38
  "skills": "^1.4.4"
39
39
  }
40
40
  }
@@ -37912,7 +37912,7 @@
37912
37912
  "path": {
37913
37913
  "slug": {
37914
37914
  "type": "string",
37915
- "description": "不带.git后缀的仓库名称。格式:`组织名称/仓库名称`",
37915
+ "description": "repo",
37916
37916
  "name": "slug",
37917
37917
  "required": true
37918
37918
  }
@@ -37920,27 +37920,27 @@
37920
37920
  "query": {
37921
37921
  "issue_rule": {
37922
37922
  "type": "string",
37923
- "description": "问题规则,用于筛选特定类型的问题。示例值:`critical-risk`, `LIC_CRITICAL`, `VUL_CRITICAL`",
37923
+ "description": "问题规则,用于筛选特定类型的问题",
37924
37924
  "name": "issue_rule",
37925
37925
  "required": false
37926
37926
  },
37927
37927
  "risk_level": {
37928
37928
  "type": "string",
37929
- "description": "严重程度,用于筛选特定风险等级的问题。枚举值:`info`, `warning`, `error`, `fatal`, `all`",
37929
+ "description": "严重程度,用于筛选特定风险等级的问题",
37930
37930
  "name": "risk_level",
37931
37931
  "required": false
37932
37932
  },
37933
37933
  "page": {
37934
37934
  "type": "number",
37935
37935
  "default": 1,
37936
- "description": "分页页码。",
37936
+ "description": "分页页码",
37937
37937
  "name": "page",
37938
37938
  "required": false
37939
37939
  },
37940
37940
  "page_size": {
37941
37941
  "type": "number",
37942
37942
  "default": 10,
37943
- "description": "分页页大小。",
37943
+ "description": "每页条数",
37944
37944
  "name": "page_size",
37945
37945
  "required": false
37946
37946
  }
@@ -37958,69 +37958,69 @@
37958
37958
  "properties": {
37959
37959
  "author_email": {
37960
37960
  "type": "string",
37961
- "description": "责任人邮箱(git 原始信息)。"
37961
+ "description": "责任人邮箱(git 原始信息)"
37962
37962
  },
37963
37963
  "author_name": {
37964
37964
  "type": "string",
37965
- "description": "责任人姓名(git 原始信息)。"
37965
+ "description": "责任人姓名(git 原始信息)"
37966
37966
  },
37967
37967
  "created_at": {
37968
37968
  "type": "string",
37969
- "description": "问题创建时间。"
37969
+ "description": "问题创建时间"
37970
37970
  },
37971
37971
  "display_name": {
37972
37972
  "type": "string",
37973
- "description": "规则展示名称。"
37973
+ "description": "规则展示名称"
37974
37974
  },
37975
37975
  "file_path": {
37976
37976
  "type": "string",
37977
- "description": "包含问题的文件路径。"
37977
+ "description": "包含问题的文件路径"
37978
37978
  },
37979
37979
  "id": {
37980
37980
  "type": "string",
37981
- "description": "问题ID"
37981
+ "description": "问题ID"
37982
37982
  },
37983
37983
  "line_no": {
37984
37984
  "type": "number",
37985
- "description": "行号。"
37985
+ "description": "行号"
37986
37986
  },
37987
37987
  "occur_version": {
37988
37988
  "type": "string",
37989
- "description": "引入问题的commit"
37989
+ "description": "引入问题的 commit"
37990
37990
  },
37991
37991
  "repo_id": {
37992
37992
  "type": "string",
37993
- "description": "仓库ID"
37993
+ "description": "仓库ID"
37994
37994
  },
37995
37995
  "revision": {
37996
37996
  "type": "string",
37997
- "description": "问题所在的commit"
37997
+ "description": "问题所在的 commit"
37998
37998
  },
37999
37999
  "risk_level": {
38000
38000
  "type": "string",
38001
- "description": "严重级别。"
38001
+ "description": "严重级别"
38002
38002
  },
38003
38003
  "rule": {
38004
38004
  "type": "string",
38005
- "description": "问题规则。"
38005
+ "description": "问题规则"
38006
38006
  },
38007
38007
  "rule_title": {
38008
38008
  "type": "string",
38009
- "description": "规则名称。"
38009
+ "description": "规则名称"
38010
38010
  },
38011
38011
  "tool": {
38012
38012
  "type": "string",
38013
- "description": "扫描工具。"
38013
+ "description": "扫描工具"
38014
38014
  }
38015
38015
  }
38016
38016
  },
38017
- "description": "问题列表。"
38017
+ "description": "问题列表"
38018
38018
  }
38019
38019
  }
38020
38020
  }
38021
38021
  },
38022
38022
  "400": {
38023
- "description": "请求参数错误。",
38023
+ "description": "请求参数错误",
38024
38024
  "schema": {
38025
38025
  "type": "object",
38026
38026
  "properties": {
@@ -38043,7 +38043,7 @@
38043
38043
  }
38044
38044
  },
38045
38045
  "500": {
38046
- "description": "服务器内部错误。",
38046
+ "description": "服务器内部错误",
38047
38047
  "schema": {
38048
38048
  "type": "object",
38049
38049
  "properties": {
@@ -38081,13 +38081,13 @@
38081
38081
  "path": {
38082
38082
  "slug": {
38083
38083
  "type": "string",
38084
- "description": "不带.git后缀的仓库名称。格式:`组织名称/仓库名称`",
38084
+ "description": "repo",
38085
38085
  "name": "slug",
38086
38086
  "required": true
38087
38087
  },
38088
38088
  "record_id": {
38089
38089
  "type": "number",
38090
- "description": "源码扫描问题记录ID",
38090
+ "description": "源码扫描问题记录ID",
38091
38091
  "name": "record_id",
38092
38092
  "required": true
38093
38093
  }
@@ -38101,89 +38101,89 @@
38101
38101
  "properties": {
38102
38102
  "author_email": {
38103
38103
  "type": "string",
38104
- "description": "责任人邮箱(git 原始信息)。"
38104
+ "description": "责任人邮箱(git 原始信息)"
38105
38105
  },
38106
38106
  "author_name": {
38107
38107
  "type": "string",
38108
- "description": "责任人姓名(git 原始信息)。"
38108
+ "description": "责任人姓名(git 原始信息)"
38109
38109
  },
38110
38110
  "created_at": {
38111
38111
  "type": "string",
38112
- "description": "问题创建时间。"
38112
+ "description": "问题创建时间"
38113
38113
  },
38114
38114
  "description": {
38115
38115
  "type": "string",
38116
- "description": "问题描述。"
38116
+ "description": "问题描述"
38117
38117
  },
38118
38118
  "display_name": {
38119
38119
  "type": "string",
38120
- "description": "规则展示名称。"
38120
+ "description": "规则展示名称"
38121
38121
  },
38122
38122
  "extra_msg": {
38123
38123
  "type": "string",
38124
- "description": "额外信息。"
38124
+ "description": "额外信息"
38125
38125
  },
38126
38126
  "file_path": {
38127
38127
  "type": "string",
38128
- "description": "包含问题的文件路径。"
38128
+ "description": "包含问题的文件路径"
38129
38129
  },
38130
38130
  "id": {
38131
38131
  "type": "string",
38132
- "description": "问题ID"
38132
+ "description": "问题ID"
38133
38133
  },
38134
38134
  "ignored_at": {
38135
38135
  "type": "string",
38136
- "description": "忽略时间。"
38136
+ "description": "忽略时间"
38137
38137
  },
38138
38138
  "introduce": {
38139
38139
  "type": "string",
38140
- "description": "问题介绍。"
38140
+ "description": "问题介绍"
38141
38141
  },
38142
38142
  "line_no": {
38143
38143
  "type": "number",
38144
- "description": "行号。"
38144
+ "description": "行号"
38145
38145
  },
38146
38146
  "occur_version": {
38147
38147
  "type": "string",
38148
- "description": "引入问题的commit"
38148
+ "description": "引入问题的 commit"
38149
38149
  },
38150
38150
  "reopen_at": {
38151
38151
  "type": "string",
38152
- "description": "重新开启时间。"
38152
+ "description": "重新开启时间"
38153
38153
  },
38154
38154
  "repo_id": {
38155
38155
  "type": "string",
38156
- "description": "仓库ID"
38156
+ "description": "仓库ID"
38157
38157
  },
38158
38158
  "revision": {
38159
38159
  "type": "string",
38160
- "description": "问题所在的commit"
38160
+ "description": "问题所在的 commit"
38161
38161
  },
38162
38162
  "risk_level": {
38163
38163
  "type": "string",
38164
- "description": "严重级别。"
38164
+ "description": "严重级别"
38165
38165
  },
38166
38166
  "rule": {
38167
38167
  "type": "string",
38168
- "description": "问题规则。"
38168
+ "description": "问题规则"
38169
38169
  },
38170
38170
  "rule_title": {
38171
38171
  "type": "string",
38172
- "description": "规则名称。"
38172
+ "description": "规则名称"
38173
38173
  },
38174
38174
  "state": {
38175
38175
  "type": "string",
38176
- "description": "问题状态(open/ignored)。"
38176
+ "description": "问题状态(open/ignored"
38177
38177
  },
38178
38178
  "tool": {
38179
38179
  "type": "string",
38180
- "description": "扫描工具。"
38180
+ "description": "扫描工具"
38181
38181
  }
38182
38182
  }
38183
38183
  }
38184
38184
  },
38185
38185
  "400": {
38186
- "description": "请求参数错误。",
38186
+ "description": "请求参数错误",
38187
38187
  "schema": {
38188
38188
  "type": "object",
38189
38189
  "properties": {
@@ -38229,7 +38229,7 @@
38229
38229
  }
38230
38230
  },
38231
38231
  "500": {
38232
- "description": "服务器内部错误。",
38232
+ "description": "服务器内部错误",
38233
38233
  "schema": {
38234
38234
  "type": "object",
38235
38235
  "properties": {
@@ -169,7 +169,6 @@ function formatParams(params) {
169
169
  if (params.help) formatted.help = true;
170
170
  if (params.short) formatted.short = true;
171
171
  if (params.verbose) formatted.verbose = true;
172
- if (params.summary) formatted.summary = true;
173
172
 
174
173
  // 旧格式兼容:--path / --query / --data 是 JSON 字符串
175
174
  if (typeof params.path === 'string') {
@@ -187,7 +186,7 @@ function formatParams(params) {
187
186
  if (paramDefs) {
188
187
  const pathDef = paramDefs.path || {};
189
188
  const queryDef = paramDefs.query || {};
190
- const reservedKeys = new Set(['module', 'tool', 'help', 'short', 'verbose', 'summary', 'path', 'query', 'data', 'h', 'v']);
189
+ const reservedKeys = new Set(['module', 'tool', 'help', 'short', 'verbose', 'path', 'query', 'data', 'h', 'v']);
191
190
  for (const [key, value] of Object.entries(params)) {
192
191
  if (reservedKeys.has(key)) continue;
193
192
  if (typeof value === 'boolean') continue;
@@ -262,8 +261,8 @@ function isStandardResponse(response) {
262
261
  /**
263
262
  * 格式化 CLI 输出
264
263
  * - verbose 模式:完整 JSON(含 trace、header 等全部字段)
265
- * - summary 模式:只输出核心摘要字段(需要 --summary 显式指定)
266
- * - 默认:精简 JSON(去掉 trace、header,保留完整 data)
264
+ * - 快捷命令默认:只输出核心摘要字段
265
+ * - 非快捷命令默认:精简 JSON(去掉 trace、header,保留完整 data)
267
266
  * @param response 原始响应
268
267
  * @param verbose 是否 verbose 模式
269
268
  * @param summary 是否 summary 模式
@@ -289,7 +288,7 @@ function formatOutput(response, verbose, summary, toolKey) {
289
288
  // 精简响应
290
289
  const compact = compactResponse(response);
291
290
 
292
- // --summary 模式:对特定 tool 应用摘要提取(仅成功响应)
291
+ // summary 模式:对特定 tool 应用摘要提取(仅成功响应)
293
292
  if (summary && compact.status >= 200 && compact.status < 300) {
294
293
  const summarized = (0, _shortcuts.summarizeResponse)(compact.data, toolKey);
295
294
  if (summarized !== null) {
@@ -342,7 +341,7 @@ ${lines.join('\n')}
342
341
  <tool> 工具名称 (如: list-issues, get-issue)
343
342
  --key value 路径或查询参数,CLI 自动识别归类
344
343
  --data 'JSON' 请求体参数,JSON 字符串
345
- --verbose 输出完整响应(含 trace、header
344
+ --verbose 输出完整原始响应(含 trace、header 等全部字段)
346
345
  --help 显示帮助文档
347
346
  --short 显示当前仓库的快捷命令
348
347
 
@@ -458,6 +457,9 @@ async function main() {
458
457
  }
459
458
  const data = await toolFunction(...toolsParam);
460
459
  const toolKey = `${formattedParams.module}/${formattedParams.tool}`;
461
- console.log(formatOutput(data, !!formattedParams.verbose, !!formattedParams.summary, toolKey));
460
+ // 快捷命令默认输出摘要,--verbose 时输出全部信息
461
+ const isVerbose = !!formattedParams.verbose;
462
+ const isSummary = shortcut ? !isVerbose : false;
463
+ console.log(formatOutput(data, isVerbose, isSummary, toolKey));
462
464
  }
463
465
  main();
@@ -161,7 +161,7 @@ function showShort() {
161
161
  ${list}
162
162
 
163
163
  提示: 以上命令自动使用环境变量 CNB_REPO_SLUG 和 CNB_ISSUE_IID,无需手动传 --path
164
- 添加 --summary 可只输出核心摘要字段
164
+ 默认只输出摘要信息,添加 --verbose 可输出全部信息
165
165
  `);
166
166
  } else if (ctx === 'pull_request') {
167
167
  const number = getPRNumber();
@@ -174,7 +174,7 @@ ${list}
174
174
  ${list}
175
175
 
176
176
  提示: 以上命令自动使用环境变量 CNB_REPO_SLUG 和 CNB_PULL_REQUEST_IID,无需手动传 --path
177
- 添加 --summary 可只输出核心摘要字段
177
+ 默认只输出摘要信息,添加 --verbose 可输出全部信息
178
178
  `);
179
179
  } else {
180
180
  // 未知上下文,两组都显示
@@ -195,7 +195,7 @@ ${prList}
195
195
  CNB_ISSUE_IID - Issue 编号 (Issue 事件)
196
196
  CNB_PULL_REQUEST_IID - PR 编号 (PR 事件)
197
197
 
198
- 添加 --summary 可只输出核心摘要字段
198
+ 默认只输出摘要信息,添加 --verbose 可输出全部信息
199
199
  `);
200
200
  }
201
201
  }
@@ -1,140 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = convertLink;
7
- /**
8
- * 把文本里的相对路径转换为绝对路径
9
- * 与 codebuddy/skills/cnb-text-relative-path-converter/scripts/convertLink.js 逻辑一致
10
- *
11
- * @param {String} text 待转换的文本
12
- * @param {String} repoSlug 仓库路径
13
- * @param {String} branchOrSha 可选,分支或SHA
14
- * @returns {String}
15
- */
16
- function convertLink(text, repoSlug, branchOrSha) {
17
- // 查询所有代码块的位置
18
- let codeBlockPositions = [];
19
- let index = 0;
20
- while (index !== -1) {
21
- const nextIndex = text.indexOf('```', index);
22
- if (nextIndex === -1) break;
23
- codeBlockPositions.push(nextIndex);
24
- index = nextIndex + 3; // 跳过已匹配的三个反引号
25
- }
26
- if (codeBlockPositions.length % 2 !== 0) {
27
- codeBlockPositions = codeBlockPositions.slice(0, codeBlockPositions.length - 1);
28
- }
29
-
30
- // 查询所有行内代码块的位置
31
- let inlineCodeBlockPositions = [];
32
- index = 0;
33
- while (index < text.length) {
34
- const nextIndex = text.indexOf('`', index);
35
- if (nextIndex === -1) break;
36
- // 检查是否是单独的反引号(不是代码块的一部分)
37
- if ((nextIndex === 0 || text.charAt(nextIndex - 1) !== '`') && (nextIndex === text.length - 1 || text.charAt(nextIndex + 1) !== '`')) {
38
- inlineCodeBlockPositions.push(nextIndex);
39
- }
40
- index = nextIndex + 1;
41
- }
42
- if (inlineCodeBlockPositions.length % 2 !== 0) {
43
- inlineCodeBlockPositions = inlineCodeBlockPositions.slice(0, inlineCodeBlockPositions.length - 1);
44
- }
45
-
46
- // 整理起始和结束位置
47
- const excludedRanges = [...codeBlockPositions, ...inlineCodeBlockPositions].reduce((result, item, index) => {
48
- if (index % 2 === 0) {
49
- return result.concat([[item]]);
50
- }
51
- result[result.length - 1].push(item);
52
- return result;
53
- }, []);
54
-
55
- // Helper function to check if an index is within excluded ranges
56
- const isInExcludedRange = index => {
57
- return excludedRanges.some(([start, end]) => index >= start && index < end);
58
- };
59
- let match;
60
-
61
- // Collect all replacements with their positions
62
- const replacements = [];
63
-
64
- // Match markdown links and images: [text](url) and ![alt](url)
65
- const markdownLinkRegex = /!?\[([^\]]+)\]\(([^)]+)\)/g;
66
- while ((match = markdownLinkRegex.exec(text)) !== null) {
67
- if (!isInExcludedRange(match.index)) {
68
- // Calculate URL position: match.index + length of "![" + match[1] + "]("
69
- const prefixLength = (match[0].startsWith('!') ? 1 : 0) + 1 + match[1].length + 2;
70
- const urlStart = match.index + prefixLength;
71
- const urlEnd = urlStart + match[2].length;
72
- const newUrl = normaliseLink(match[2], repoSlug, branchOrSha);
73
- if (newUrl !== match[2]) {
74
- replacements.push({
75
- start: urlStart,
76
- end: urlEnd,
77
- newUrl
78
- });
79
- }
80
- }
81
- }
82
-
83
- // Match HTML tags: <img src="..."> and <a href="...">
84
- const htmlTagRegex = /\s(src|href)=["']([^"']+)["']/gi;
85
- while ((match = htmlTagRegex.exec(text)) !== null) {
86
- if (!isInExcludedRange(match.index)) {
87
- const urlStart = match.index + match[0].indexOf(match[2]);
88
- const urlEnd = urlStart + match[2].length;
89
- const newUrl = normaliseLink(match[2], repoSlug, branchOrSha);
90
- if (newUrl !== match[2]) {
91
- replacements.push({
92
- start: urlStart,
93
- end: urlEnd,
94
- newUrl
95
- });
96
- }
97
- }
98
- }
99
-
100
- // Sort replacements by start position in descending order
101
- replacements.sort((a, b) => b.start - a.start);
102
-
103
- // Apply replacements from end to start to maintain correct indices
104
- let result = text;
105
- for (const {
106
- start,
107
- end,
108
- newUrl
109
- } of replacements) {
110
- result = result.substring(0, start) + newUrl + result.substring(end);
111
- }
112
- return result;
113
- }
114
-
115
- /**
116
- * 相对路径转换为绝对路径
117
- * 与 codebuddy/skills/text-path-converter/scripts/convertLink.js 逻辑一致
118
- *
119
- * @param {String} link 待转换的链接
120
- * @param {String} repoSlug 仓库路径
121
- * @param {String} branchOrSha 分支或SHA,默认为 HEAD
122
- * @returns {String}
123
- */
124
- function normaliseLink(link, repoSlug, branchOrSha = 'HEAD') {
125
- const baseURL = `${process.env.CNB_WEB_ENDPOINT}/${repoSlug}`;
126
- if (link.startsWith('/-/')) {
127
- return `${baseURL}${link}`;
128
- }
129
- if (link.indexOf('/-/') === -1 && (link.startsWith('../') || link.startsWith('./') || link.startsWith('/') && !link.startsWith('//'))) {
130
- let chunks = link.split('/');
131
- // 过滤掉空字符串和 . .. 这些无效路径
132
- chunks = chunks.filter(chunk => !!chunk && chunk !== '.' && chunk !== '..');
133
- if (chunks.length === 0) {
134
- return link;
135
- }
136
- chunks.unshift(branchOrSha);
137
- return `${baseURL}/-/git/raw/${chunks.join('/')}`;
138
- }
139
- return link;
140
- }
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _core = _interopRequireDefault(require("../../core/core.js"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- // @ts-nocheck
10
- /* tslint:disable */
11
- /* eslint-disable */
12
- /*
13
- * -------------------------------------------------------------------------
14
- * ## THIS FILE WAS GENERATED VIA CNB-API-GENERATE ##
15
- * ## ##
16
- * ## AUTHOR: bapelin ##
17
- * ## SOURCE: https://cnb.cool/cnb/frontend-science/cnb-api-generate ##
18
- * -------------------------------------------------------------------------
19
- * @Version 1.2.1
20
- * @Source /{repo}/-/build/ai/auto-pr
21
- */
22
-
23
- /**
24
- * @description Other reuqest params
25
- */
26
-
27
- /**
28
- * @description AiAutoPrRes Success Response Type
29
- */
30
-
31
- /**
32
- * @description AiAutoPrError Error Response Type
33
- */
34
-
35
- /**
36
- * @description 访问令牌调用此接口需包含以下权限。Required permissions for access token.
37
- * repo-code:rw
38
- * @tags AI
39
- * @name aiAutoPr
40
- * @summary 根据传入的需求内容和需求标题借助 AI 自动编码并提 PR。Automatically code and create a PR with AI based on the input requirement content and title.
41
- * @request post:/{repo}/-/build/ai/auto-pr
42
-
43
- ----------------------------------
44
- * @param {string} arg0
45
- * @param {DtoAiAutoPrReq} arg1
46
- * @param {RequestConfig} arg2 - Other reuqest params
47
- */
48
- async function _default(repo, request, {
49
- req,
50
- options,
51
- ...axiosConfig
52
- } = {}) {
53
- return await _core.default.request({
54
- ...axiosConfig,
55
- _next_req: req,
56
- options: options,
57
- url: `/${repo}/-/build/ai/auto-pr`,
58
- _apiTag: "/{repo}/-/build/ai/auto-pr",
59
- method: "post",
60
- data: request,
61
- _originParams: {
62
- method: "post",
63
- _apiTag: "/{repo}/-/build/ai/auto-pr",
64
- path: {
65
- repo
66
- },
67
- body: request
68
- }
69
- });
70
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _core = _interopRequireDefault(require("../../core/core.js"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- // @ts-nocheck
10
- /* tslint:disable */
11
- /* eslint-disable */
12
- /*
13
- * -------------------------------------------------------------------------
14
- * ## THIS FILE WAS GENERATED VIA CNB-API-GENERATE ##
15
- * ## ##
16
- * ## AUTHOR: bapelin ##
17
- * ## SOURCE: https://cnb.woa.com/cnb/frontend-science/cnb-api-generate ##
18
- * -------------------------------------------------------------------------
19
- * @Version 2.2.0
20
- * @Source /{repo}/-/files/{filePath}
21
- */
22
-
23
- /**
24
- * @description getFiles request params
25
- */
26
-
27
- /**
28
- * @description Other reuqest params
29
- */
30
-
31
- /**
32
- * @description GetFilesRes Success Response Type
33
- */
34
-
35
- /**
36
- * @description GetFilesError Error Response Type
37
- */
38
-
39
- /**
40
- * @description 访问令牌调用此接口需包含以下权限。Required permissions for access token.
41
- * repo-contents:r
42
- * @tags Pulls,Issues
43
- * @name getFiles
44
- * @summary 获取 issue 文件或合并请求文件的请求,返回文件二进制内容。Request to retrieve file of issues and pull requests, returns binary content.
45
- * @request get:/{repo}/-/files/{filePath}
46
-
47
- ----------------------------------
48
- * @param {GetFilesParams} arg0 - getFiles request params
49
- * @param {RequestConfig} arg1 - Other reuqest params
50
- */
51
- async function _default({
52
- repo,
53
- filePath
54
- }, {
55
- req,
56
- options,
57
- ...axiosConfig
58
- } = {}) {
59
- return await _core.default.request({
60
- ...axiosConfig,
61
- _next_req: req,
62
- options: options,
63
- url: `/${repo}/-/files/${filePath}`,
64
- _apiTag: "/{repo}/-/files/{filePath}",
65
- method: "get",
66
- _originParams: {
67
- method: "get",
68
- _apiTag: "/{repo}/-/files/{filePath}",
69
- path: {
70
- repo,
71
- filePath
72
- }
73
- }
74
- });
75
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = _default;
7
- var _core = _interopRequireDefault(require("../../core/core.js"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- // @ts-nocheck
10
- /* tslint:disable */
11
- /* eslint-disable */
12
- /*
13
- * -------------------------------------------------------------------------
14
- * ## THIS FILE WAS GENERATED VIA CNB-API-GENERATE ##
15
- * ## ##
16
- * ## AUTHOR: bapelin ##
17
- * ## SOURCE: https://cnb.woa.com/cnb/frontend-science/cnb-api-generate ##
18
- * -------------------------------------------------------------------------
19
- * @Version 2.2.0
20
- * @Source /{repo}/-/imgs/{imgPath}
21
- */
22
-
23
- /**
24
- * @description getImgs request params
25
- */
26
-
27
- /**
28
- * @description Other reuqest params
29
- */
30
-
31
- /**
32
- * @description GetImgsRes Success Response Type
33
- */
34
-
35
- /**
36
- * @description GetImgsError Error Response Type
37
- */
38
-
39
- /**
40
- * @description 访问令牌调用此接口需包含以下权限。Required permissions for access token.
41
- * repo-contents:r
42
- * @tags Pulls,Issues
43
- * @name getImgs
44
- * @summary 获取 issue 图片或合并请求图片的请求,返回图片二进制内容。Request to retrieve image of issues and pull requests, returns binary content.
45
- * @request get:/{repo}/-/imgs/{imgPath}
46
-
47
- ----------------------------------
48
- * @param {GetImgsParams} arg0 - getImgs request params
49
- * @param {RequestConfig} arg1 - Other reuqest params
50
- */
51
- async function _default({
52
- repo,
53
- imgPath
54
- }, {
55
- req,
56
- options,
57
- ...axiosConfig
58
- } = {}) {
59
- return await _core.default.request({
60
- ...axiosConfig,
61
- _next_req: req,
62
- options: options,
63
- url: `/${repo}/-/imgs/${imgPath}`,
64
- _apiTag: "/{repo}/-/imgs/{imgPath}",
65
- method: "get",
66
- _originParams: {
67
- method: "get",
68
- _apiTag: "/{repo}/-/imgs/{imgPath}",
69
- path: {
70
- repo,
71
- imgPath
72
- }
73
- }
74
- });
75
- }