@cnbcool/cnb-api-generate 2.11.2 → 2.11.4

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,6 +123,8 @@ 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;
126
128
  name: string;
127
129
  path?: string;
128
130
  size: number;
@@ -281,10 +283,13 @@ export async function handleIssueCreateUpload(
281
283
  if (putErr) return putErr;
282
284
 
283
285
  // 3. 返回结果(asset_link 拼入创建 issue 的 body,asset_group_id 备用)
286
+ // markdown 作为 asset_link 的别名,方便 AI 理解使用
287
+ const assetLink = firstEntry?.asset_link;
284
288
  return {
285
289
  status: 200,
286
290
  data: {
287
- asset_link: firstEntry?.asset_link,
291
+ asset_link: assetLink,
292
+ markdown: assetLink,
288
293
  name: firstEntry?.name || fileName,
289
294
  path: firstEntry?.path,
290
295
  size: fileSize,
@@ -340,8 +345,10 @@ export async function handleUpload(
340
345
  const data = apiResponse?.data as IssueAssetUploadURLResponseData | undefined;
341
346
  uploadUrl = data?.upload_url;
342
347
  if (!uploadUrl) return apiResponse as unknown as UploadResult;
348
+ const assetLink = data?.asset_link;
343
349
  successData = {
344
- asset_link: data?.asset_link,
350
+ asset_link: assetLink,
351
+ markdown: assetLink,
345
352
  name: data?.name || fileName,
346
353
  path: data?.path,
347
354
  size: fileSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "2.11.2",
3
+ "version": "2.11.4",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",