From 0f127dbc70c62f13ab9a078f16684385fe0336f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 7 Oct 2026 13:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B8=B8=E6=88=8F=E5=88=86?= =?UTF-8?q?=E5=8F=91=20E2E=20helper=20=E4=B8=AD=E6=97=A0=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 coverImagePart:各 E2E 脚本都有自己的本地实现,仓库内无人导入 - COVER_PNG 只作 imagePart 的默认值,收回 export --- scripts/game-distribution-e2e-helpers.mjs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/scripts/game-distribution-e2e-helpers.mjs b/scripts/game-distribution-e2e-helpers.mjs index 8dc3a89f5..baef41c49 100644 --- a/scripts/game-distribution-e2e-helpers.mjs +++ b/scripts/game-distribution-e2e-helpers.mjs @@ -5,7 +5,7 @@ // 这里收敛这段稳定契约,脚本只保留自己的路径、鉴权头与返回形状差异。 /** 1x1 透明 PNG:仅用于满足发布必填的封面/截图 part,内容不参与断言。 */ -export const COVER_PNG = Buffer.from( +const COVER_PNG = Buffer.from( 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64', ); @@ -25,19 +25,6 @@ export function imagePart(kind, id, options = {}) { return { bytes, fileName, contentType }; } -/** - * 封面 part 便捷封装:等价于 `imagePart('cover', id, options)`。 - * - * 脚本可用 `options.fileName` 给出完整文件名,或用 `options.namePrefix` 生成 - * `-.png`。 - */ -export function coverImagePart(id, options = {}) { - const { namePrefix, fileName, ...rest } = options; - const resolvedFileName = - fileName ?? (namePrefix ? `${namePrefix}-${id}.png` : `cover-${id}.png`); - return imagePart('cover', id, { ...rest, fileName: resolvedFileName }); -} - /** * 组装发布请求体:`metadata` 文本 part + 可选 `cover` / 按顺序重复的 `screenshot` 二进制 part。 *