@cnbcool/cnb-api-generate 2.11.5 → 2.11.6

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.
@@ -123,8 +123,6 @@ interface UploadErrorData {
123
123
  /** Issue 上传成功时的 data(asset_group_id 仅在创建 issue 流程下返回) */
124
124
  interface IssueUploadData {
125
125
  asset_link?: string;
126
- /** asset_link 的别名,语义更直观,方便 AI 理解这是一个可直接插入评论的 markdown 链接 */
127
- markdown?: string;
128
126
  name: string;
129
127
  path?: string;
130
128
  size: number;
@@ -133,9 +131,6 @@ interface IssueUploadData {
133
131
 
134
132
  /** Pull 上传成功时的 data */
135
133
  interface PullUploadData {
136
- /** asset_link 的别名,语义更直观,方便 AI 理解这是一个可直接插入评论的 markdown 链接 */
137
- asset_link?: string;
138
- markdown?: string;
139
134
  name: string;
140
135
  path?: string;
141
136
  size: number;
@@ -286,13 +281,10 @@ export async function handleIssueCreateUpload(
286
281
  if (putErr) return putErr;
287
282
 
288
283
  // 3. 返回结果(asset_link 拼入创建 issue 的 body,asset_group_id 备用)
289
- // markdown 作为 asset_link 的别名,方便 AI 理解使用
290
- const assetLink = firstEntry?.asset_link;
291
284
  return {
292
285
  status: 200,
293
286
  data: {
294
- asset_link: assetLink,
295
- markdown: assetLink,
287
+ asset_link: firstEntry?.asset_link,
296
288
  name: firstEntry?.name || fileName,
297
289
  path: firstEntry?.path,
298
290
  size: fileSize,
@@ -348,10 +340,8 @@ export async function handleUpload(
348
340
  const data = apiResponse?.data as IssueAssetUploadURLResponseData | undefined;
349
341
  uploadUrl = data?.upload_url;
350
342
  if (!uploadUrl) return apiResponse as unknown as UploadResult;
351
- const assetLink = data?.asset_link;
352
343
  successData = {
353
- asset_link: assetLink,
354
- markdown: assetLink,
344
+ asset_link: data?.asset_link,
355
345
  name: data?.name || fileName,
356
346
  path: data?.path,
357
347
  size: fileSize,
@@ -363,19 +353,9 @@ export async function handleUpload(
363
353
  const data = apiResponse?.data as PullUploadResponseData | undefined;
364
354
  uploadUrl = data?.upload_url;
365
355
  if (!uploadUrl) return apiResponse as unknown as UploadResult;
366
- // markdown 作为 asset_link 的别名,方便 AI 理解使用
367
- // Pull 上传不返回 asset_link,由 assets.path + name 构造 markdown 链接
368
- const assetPath = data?.assets?.path;
369
- const assetName = data?.assets?.name || fileName;
370
- const isImage = shortcut.kind === 'image';
371
- const assetLink = assetPath
372
- ? `${isImage ? '!' : ''}[${assetName}](${assetPath})`
373
- : undefined;
374
356
  successData = {
375
- asset_link: assetLink,
376
- markdown: assetLink,
377
- name: assetName,
378
- path: assetPath,
357
+ name: data?.assets?.name || fileName,
358
+ path: data?.assets?.path,
379
359
  size: fileSize,
380
360
  token: data?.token,
381
361
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "2.11.5",
3
+ "version": "2.11.6",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -27,8 +27,8 @@
27
27
  { "shortName": "check-status", "realTool": "list-pull-commit-statuses", "description": "查看 CI 状态" },
28
28
  { "shortName": "list-reviews", "realTool": "list-pull-reviews", "description": "查看评审列表" },
29
29
  { "shortName": "list-assignees", "realTool": "list-pull-assignees", "description": "查看处理人" },
30
- { "shortName": "upload-file", "realTool": "upload-files", "description": "上传文件", "repoOnly": true, "upload": true, "kind": "file", "dataTip": "--file 文件路径" },
31
- { "shortName": "upload-image", "realTool": "upload-imgs", "description": "上传图片", "repoOnly": true, "upload": true, "kind": "image", "dataTip": "--file 图片路径" },
30
+ { "shortName": "upload-file", "realTool": "upload-files", "description": "上传文件", "repoOnly": true, "upload": true, "dataTip": "--file 文件路径" },
31
+ { "shortName": "upload-image", "realTool": "upload-imgs", "description": "上传图片", "repoOnly": true, "upload": true, "dataTip": "--file 图片路径" },
32
32
  { "shortName": "get-ci-logs", "realTool": "__get-ci-logs__", "description": "获取 CI 失败日志", "repoOnly": true, "custom": true, "dataTip": "--sn 构建号(可选)" },
33
33
  { "shortName": "get-ci-timing", "realTool": "__get-ci-timing__", "description": "分析 CI 耗时瓶颈", "repoOnly": true, "custom": true, "dataTip": "--sn 构建号(可选)" },
34
34
  { "shortName": "get-imgs", "realTool": "get-pr-imgs", "description": "获取 PR 图片", "repoOnly": true, "dataTip": "--img-path 图片路径" },