diff --git a/.codex-tasks/template-audit-execution/raw/completion-evidence.json b/.codex-tasks/template-audit-execution/raw/completion-evidence.json index 6f81fa8..d080af6 100644 --- a/.codex-tasks/template-audit-execution/raw/completion-evidence.json +++ b/.codex-tasks/template-audit-execution/raw/completion-evidence.json @@ -1,23 +1,23 @@ { "schemaVersion": 1, "scope": "模板完成证据登记,保留命令、日志与产物哈希", - "generatedAt": "2026-10-19T20:11:56.461+08:00", + "generatedAt": "2026-10-20T09:00:52.740+00:00", "templates": { "acheng-campus-food": { "real-manifest-interaction": { "status": "passed", "commands": [ "pnpm --filter @personal-brand/api test:integration", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" } ], "exitCode": 0 @@ -29,8 +29,12 @@ ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" + }, + { + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log", + "sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e" } ], "exitCode": 0 @@ -38,24 +42,24 @@ "visual-reference": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/01-acheng-campus-food-food-320.png", - "sha256": "8e8725895c61af3b77202d00a40a61c4e17d298ff9d2d47940a87565d8089329" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-320.png", + "sha256": "3aa442379e6847eeda18b97df78fadb077f6b678ee09f99d692b8fd357d37422" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/01-acheng-campus-food-food-375.png", - "sha256": "4cfb078edea3b5223d7bd11899daeac67b4ccf84828f234a600b7429f3e3048f" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-375.png", + "sha256": "a0cc26679391dc851056551dcd5b31f50603bfd0dc44a59bc5182ea377a2747f" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/01-acheng-campus-food-food-390.png", - "sha256": "81113e44e82dc898a94d8755ff5ec8e248e4d5d0cb8eec7f100a694dc9d449da" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-390.png", + "sha256": "f5d517380140ed62bb306a79fdbf818e1846c7ff58ebf229c2c8ed1142221537" } ], "exitCode": 0 @@ -63,33 +67,21 @@ "empty-error-branches": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-01-acheng-campus-food-food.png", - "sha256": "57360e276a98b1a2623114acb64bc3fc826f69a3cf9dfb961961f0fced5d90af" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-02-atelier-solopreneur-personal.png", - "sha256": "32f6d6c2191da4aa23b4d27b2c89457db713aba46422eb7e7618f65676c70fd4" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-03-linjing-editorial-personal.png", - "sha256": "433a469d71f7fbe3514ff5ca8faf642848f6d64ebe09a076b60a2d160e7e8305" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-04-linjing-editorial-doors.png", - "sha256": "5eaa90f39e05766c86bebd35598d9130b7548c34a77d82ce85d1ff8b3e5311c9" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-01-acheng-campus-food-food.png", + "sha256": "2a8279db468ab65426f1cf5e13ff8dcffa6ef625bf9f3dd563165b8905a79043" } ], "exitCode": 0 @@ -100,16 +92,16 @@ "status": "passed", "commands": [ "pnpm --filter @personal-brand/api test:integration", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" } ], "exitCode": 0 @@ -121,8 +113,12 @@ ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" + }, + { + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log", + "sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e" } ], "exitCode": 0 @@ -130,23 +126,23 @@ "visual-reference": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/02-atelier-solopreneur-personal-320.png", + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-320.png", "sha256": "e55af9899393c7f9cfba9bb2b5c6ad6c447f90cf28dddd94da8feb6702fc8477" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/02-atelier-solopreneur-personal-375.png", + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-375.png", "sha256": "70d251ab829ebfc85dba7fd65ac423272af4af54b39f76d1bea9ebbe0f89bc2d" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/02-atelier-solopreneur-personal-390.png", + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-390.png", "sha256": "a430e7c72f794d62f9f0248c52307b6f644ea5b6099ba6c8b929f365504c3b07" } ], @@ -155,33 +151,21 @@ "empty-error-branches": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-01-acheng-campus-food-food.png", - "sha256": "57360e276a98b1a2623114acb64bc3fc826f69a3cf9dfb961961f0fced5d90af" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-02-atelier-solopreneur-personal.png", - "sha256": "32f6d6c2191da4aa23b4d27b2c89457db713aba46422eb7e7618f65676c70fd4" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-03-linjing-editorial-personal.png", - "sha256": "433a469d71f7fbe3514ff5ca8faf642848f6d64ebe09a076b60a2d160e7e8305" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-04-linjing-editorial-doors.png", - "sha256": "5eaa90f39e05766c86bebd35598d9130b7548c34a77d82ce85d1ff8b3e5311c9" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-02-atelier-solopreneur-personal.png", + "sha256": "78982dd7aa7a8751e29969de9f68c6c3eab0bcdb2403f1a5442f10cc03b9a843" } ], "exitCode": 0 @@ -192,16 +176,16 @@ "status": "passed", "commands": [ "pnpm --filter @personal-brand/api test:integration", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" } ], "exitCode": 0 @@ -213,8 +197,12 @@ ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log", - "sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log", + "sha256": "1efcc2e20c32dc9b42f960a6967a6e94a32aa9e49ca855c17d61b2bc7f6ab891" + }, + { + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log", + "sha256": "8a7a4bbd46be04b7c89318b702886d75acdb3707d9035c789e1d0550fd052b6e" } ], "exitCode": 0 @@ -222,36 +210,24 @@ "visual-reference": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/03-linjing-editorial-personal-320.png", - "sha256": "91ddbc9bd44476f55177320f241ba92dcedb80fb684aef525e0b25d5f7bbafc0" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-320.png", + "sha256": "d1569323ca5514b2348338a4c6f37bc3078c2e827e17943437efe8f437dd1188" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/03-linjing-editorial-personal-375.png", - "sha256": "6ead246000fb3039924c3451785d02facedf1d91dc39d37b567be427825ee2bf" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-375.png", + "sha256": "48960348d896631b6c0c788a5528a21e7eefe3339dfffdbff43330c062f7b983" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/03-linjing-editorial-personal-390.png", - "sha256": "46a2c912ec4d8ec0beaff9bd87fa0960b06dcdd52a341a6c487d5ecbb019b85a" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/04-linjing-editorial-doors-320.png", - "sha256": "024c48d7f72d5466dade9734bb52252ac929be8fe8f0003c33ce742263d515b5" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/04-linjing-editorial-doors-375.png", - "sha256": "22649b1c9bb680b88a70be890a7e869fe807a3ce9da5fb162d4d832c0ead39c8" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/04-linjing-editorial-doors-390.png", - "sha256": "a9fbee6a7e96c267d5960bc85061433ac3400971dcfe1ef35c1a6344313ce1ba" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-390.png", + "sha256": "dd893c5958c3f4165ae988fef7be6882b27ccb3260112676ae296f2e6fef6be6" } ], "exitCode": 0 @@ -259,38 +235,26 @@ "empty-error-branches": { "status": "passed", "commands": [ - "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19 ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", - "ADMIN_URL=http://localhost:3005 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" + "TEMPLATE_PREVIEW_VISUAL_EVIDENCE=/home/que01/Project/persionalBrand/.codex-tasks/template-audit-execution/raw/visual-matrix-final ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/template-preview-media.spec.ts", + "ADMIN_URL=http://localhost:3000 pnpm --filter @personal-brand/taro exec playwright test test/browser/admin-editor.spec.ts" ], "artifacts": [ { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/template-preview-media.log", - "sha256": "70cb23333a92751d8d711bbb9c9e0351b4b27c4b3bf9cf92fa74cfc6e70d8886" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log", + "sha256": "3eb8132e3fae6c95e2820d2979422ab63ab93e52426de8bcd528fd16b36eba3c" }, { - "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log", - "sha256": "01323485f57007c7c932bc239ab07ad8147cfd3efef8eae885e524f90a93dd43" + "path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log", + "sha256": "281c1bba68b5f6e30438d925ea58d8454bd98cf538fab8217710c7dc4402d103" }, { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-01-acheng-campus-food-food.png", - "sha256": "57360e276a98b1a2623114acb64bc3fc826f69a3cf9dfb961961f0fced5d90af" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-02-atelier-solopreneur-personal.png", - "sha256": "32f6d6c2191da4aa23b4d27b2c89457db713aba46422eb7e7618f65676c70fd4" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-03-linjing-editorial-personal.png", - "sha256": "433a469d71f7fbe3514ff5ca8faf642848f6d64ebe09a076b60a2d160e7e8305" - }, - { - "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-2026-10-19/empty-04-linjing-editorial-doors.png", - "sha256": "5eaa90f39e05766c86bebd35598d9130b7548c34a77d82ce85d1ff8b3e5311c9" + "path": ".codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-03-linjing-editorial-doors.png", + "sha256": "d7b2b3197e426f1dd9b2ef99cd8682cb4c34531163b8ba5ebc90453438521970" } ], "exitCode": 0 } } }, - "sourceTreeHash": "34ff0c48bc5a76d57949e3fa234865f0a940ed3cd87f75ac2d7f5abee81fa5cd" + "sourceTreeHash": "775950266c3ec796f5af6eafabedae91a1fa6c1d4c71b29ca8d5b589b4846473" } diff --git a/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log new file mode 100644 index 0000000..376dfff --- /dev/null +++ b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-integration.log @@ -0,0 +1,1255 @@ + +> @personal-brand/api@ test:integration /home/que01/Project/persionalBrand/apps/api +> pnpm build && node --env-file=.env test/template-contract-migration.integration.mjs && node --env-file=.env test/run-integration.cjs && pnpm --filter @personal-brand/api exec tsx --test test/http.upload.test.js + + +> @personal-brand/api@ build /home/que01/Project/persionalBrand/apps/api +> tsc -p tsconfig.json + +Template contract migration populated-data rehearsal passed +Environment variables loaded from .env +Prisma schema loaded from prisma/schema.prisma +Datasource "db": PostgreSQL database "personal_brand", schema "pb_test_8b63b58bddbb589a" at "localhost:5432" + +48 migrations found in prisma/migrations + +Applying migration `20260918161022_init` +Applying migration `20260919121500_unique_service_name` +Applying migration `20260919122000_add_brand_template` +Applying migration `20260919123000_add_inquiry_request_type` +Applying migration `20260919123500_add_service_config` +Applying migration `20260919124500_add_trust_content` +Applying migration `20260919144423_add_brand_workspace_models` +Applying migration `20260920174000_add_template_snapshot` +Applying migration `20260920175000_add_template_upgrade_history` +Applying migration `20260921120000_add_offering_refs_to_bookings` +Applying migration `20260921122000_add_brand_config` +Applying migration `20260921123000_add_inquiry_form_semantics` +Applying migration `20260921130000_add_booking_workflow` +Applying migration `20260921150000_backfill_service_offerings` +Applying migration `20260921170000_remove_service_model` +Applying migration `20260921200000_add_submission_offering_snapshot` +Applying migration `20260922090000_add_inquiry_followup_status` +Applying migration `20260922165255_add_capability_audit_logs` +Applying migration `20260922180928_add_brand_memberships` +Applying migration `20260922200000_add_brand_slug` +Applying migration `20260923100000_add_capability_installations` +Applying migration `20260923180000_add_inquiry_submission_customer_subject` +Applying migration `20260924090000_add_admin_password_state` +Applying migration `20260924100000_add_brand_releases` +Applying migration `20260924120000_add_release_revocation_actor` +Applying migration `20260926100000_remove_brand_modules` +Applying migration `20260927100000_normalize_trust_content_types` +Applying migration `20261011120000_normalize_offering_categories` +Applying migration `20261011200000_normalize_seed_media_to_local` +Applying migration `20261011200001_normalize_release_media_to_local` +Applying migration `20261011230000_remove_linran_brand` +Applying migration `20261011230000_restore_original_seed_media` +Applying migration `20261011230100_restore_release_seed_media` +Applying migration `20261011230200_restore_sample_media_by_brand` +Applying migration `20261013000000_add_miniapp_release_tasks` +Applying migration `20261013010000_add_miniapp_release_settings` +Applying migration `20261013120000_add_miniapp_build_transparency` +Applying migration `20261013130000_normalize_miniapp_build_status` +Applying migration `20261016000000_add_template_package_catalog` +Applying migration `20261016010000_add_template_catalog_lifecycle` +Applying migration `20261016220000_template_bootstrap_imports` +Applying migration `20261017100000_add_miniapp_operation_attempts` +Applying migration `20261017110000_backfill_miniapp_stage_status` +Applying migration `20261017120000_template_operation_failure_events` +Applying migration `20261018120000_enforce_single_template_contract` +Applying migration `20261018170000_add_admin_token_version` +Applying migration `20261018180000_add_customer_token_version` +Applying migration `20261019100000_remove_brand_profile_defaults` + +The following migration(s) have been applied: + +migrations/ + └─ 20260918161022_init/ + └─ migration.sql + └─ 20260919121500_unique_service_name/ + └─ migration.sql + └─ 20260919122000_add_brand_template/ + └─ migration.sql + └─ 20260919123000_add_inquiry_request_type/ + └─ migration.sql + └─ 20260919123500_add_service_config/ + └─ migration.sql + └─ 20260919124500_add_trust_content/ + └─ migration.sql + └─ 20260919144423_add_brand_workspace_models/ + └─ migration.sql + └─ 20260920174000_add_template_snapshot/ + └─ migration.sql + └─ 20260920175000_add_template_upgrade_history/ + └─ migration.sql + └─ 20260921120000_add_offering_refs_to_bookings/ + └─ migration.sql + └─ 20260921122000_add_brand_config/ + └─ migration.sql + └─ 20260921123000_add_inquiry_form_semantics/ + └─ migration.sql + └─ 20260921130000_add_booking_workflow/ + └─ migration.sql + └─ 20260921150000_backfill_service_offerings/ + └─ migration.sql + └─ 20260921170000_remove_service_model/ + └─ migration.sql + └─ 20260921200000_add_submission_offering_snapshot/ + └─ migration.sql + └─ 20260922090000_add_inquiry_followup_status/ + └─ migration.sql + └─ 20260922165255_add_capability_audit_logs/ + └─ migration.sql + └─ 20260922180928_add_brand_memberships/ + └─ migration.sql + └─ 20260922200000_add_brand_slug/ + └─ migration.sql + └─ 20260923100000_add_capability_installations/ + └─ migration.sql + └─ 20260923180000_add_inquiry_submission_customer_subject/ + └─ migration.sql + └─ 20260924090000_add_admin_password_state/ + └─ migration.sql + └─ 20260924100000_add_brand_releases/ + └─ migration.sql + └─ 20260924120000_add_release_revocation_actor/ + └─ migration.sql + └─ 20260926100000_remove_brand_modules/ + └─ migration.sql + └─ 20260927100000_normalize_trust_content_types/ + └─ migration.sql + └─ 20261011120000_normalize_offering_categories/ + └─ migration.sql + └─ 20261011200000_normalize_seed_media_to_local/ + └─ migration.sql + └─ 20261011200001_normalize_release_media_to_local/ + └─ migration.sql + └─ 20261011230000_remove_linran_brand/ + └─ migration.sql + └─ 20261011230000_restore_original_seed_media/ + └─ migration.sql + └─ 20261011230100_restore_release_seed_media/ + └─ migration.sql + └─ 20261011230200_restore_sample_media_by_brand/ + └─ migration.sql + └─ 20261013000000_add_miniapp_release_tasks/ + └─ migration.sql + └─ 20261013010000_add_miniapp_release_settings/ + └─ migration.sql + └─ 20261013120000_add_miniapp_build_transparency/ + └─ migration.sql + └─ 20261013130000_normalize_miniapp_build_status/ + └─ migration.sql + └─ 20261016000000_add_template_package_catalog/ + └─ migration.sql + └─ 20261016010000_add_template_catalog_lifecycle/ + └─ migration.sql + └─ 20261016220000_template_bootstrap_imports/ + └─ migration.sql + └─ 20261017100000_add_miniapp_operation_attempts/ + └─ migration.sql + └─ 20261017110000_backfill_miniapp_stage_status/ + └─ migration.sql + └─ 20261017120000_template_operation_failure_events/ + └─ migration.sql + └─ 20261018120000_enforce_single_template_contract/ + └─ migration.sql + └─ 20261018170000_add_admin_token_version/ + └─ migration.sql + └─ 20261018180000_add_customer_token_version/ + └─ migration.sql + └─ 20261019100000_remove_brand_profile_defaults/ + └─ migration.sql + +All migrations have been successfully applied. +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [NestFactory] Starting Nest application... +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] HealthModule dependencies initialized +20ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] AppModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] InfrastructureModule dependencies initialized +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] BookingModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] PublicModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] TenantModule dependencies initialized +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] SessionModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] CustomerModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [InstanceLoader] AdminModule dependencies initialized +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicController {/public}: +8ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/brand, GET} route +2ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicTrustContentController {/public/trust-content}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/trust-content, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicTemplateController {/public/templates}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/templates, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/templates/preview, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/templates/:key, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicWorkspaceController {/public/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/workspace, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicOfferingController {/public/offerings}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/offerings, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/offerings/:id, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] PublicInquiryFormController {/public/inquiry-forms}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/public/inquiry-forms/:id, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] CustomerInquirySubmissionController {/customer/inquiry-submissions}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions/:id, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] CustomerBookingController {/customer/bookings}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/bookings, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/bookings, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/bookings/:id/cancel, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/session/logout, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/customer/session/wechat, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminSessionController {/admin/session}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/session/login, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/session/current, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/session/logout, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/session/change-password, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] TenantController {/admin/brands}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands/creation-options, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands/members, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands/members, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands/members/:id, PATCH} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/brands/:brandId/switch, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminWorkspacePreviewController {/admin/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/preview, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/install, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/select-version, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminTemplateController {/admin/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/options, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/preview, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/upgrade, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/rollback, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminCapabilityController {/admin/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/preview, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/import, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities/:key, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminOfferingController {/admin/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, DELETE} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminInquiryController {/admin/workspace}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, PATCH} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, DELETE} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions/:id, PATCH} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms/:id, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminConfigController {/admin/config}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/brand, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/brand, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/presentation, PATCH} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, DELETE} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminReleaseController {/admin/releases}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/releases, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/releases/readiness, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/releases/publish, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/releases/:version/rollback, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/releases/revoke, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminMiniAppReleaseController {/admin/miniapp-releases}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/latest, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, PATCH} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/upload, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/status, PATCH} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminUploadController {/admin/uploads}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/uploads/config, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/uploads/presign, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminLocalUploadController {/admin/uploads}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/uploads/local, PUT} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminBookingController {/admin/bookings}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/unread-count, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/status, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/read, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/tags, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] AdminTemplatePackageController {/admin/templates}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates/import, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/publish, POST} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/retire, POST} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/audit, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/preview, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] TemplateOperationMetricsController {/admin/template-operations}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/admin/template-operations/failures, GET} route +1ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RoutesResolver] HealthController {/health}: +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [RouterExplorer] Mapped {/health, GET} route +0ms +[Nest] 332859 - 10/20/2026, 5:00:18 PM LOG [NestApplication] Nest application successfully started +2ms +Workspace template packages validated: 3 +template package: acheng-campus-food@1.0.3 +content checksum: 250114e1bd6c476e9832918cdca538b6652a75b390ba0d72925c7f91019f4593 +archive checksum: 664b0bc531993c92d9e083326337d62f03c06bf84a9e4a19d324ed35b7023f41 +directory: ../../../../tmp/pb-template-integration-SjkQmO/acheng-campus-food-1.0.3 +archive: ../../../../tmp/pb-template-integration-SjkQmO/acheng-campus-food-1.0.3.tar.gz +Workspace template packages validated: 3 +template package: linjing-editorial@1.0.7 +content checksum: 76851aa5894a90eaa1d3d1324e7ad61c59b4c2ba48b33615817633d9f2389ba0 +archive checksum: fbb0947098c63a8e7e3a9a7b9c9376f52f0732773e045744a9216dafd2de2139 +directory: ../../../../tmp/pb-template-integration-mHi9Sv/linjing-editorial-1.0.7 +archive: ../../../../tmp/pb-template-integration-mHi9Sv/linjing-editorial-1.0.7.tar.gz +Workspace template packages validated: 3 +template package: atelier-solopreneur@1.3.2 +content checksum: 2a3c1920dffda11b4c4171ebad9c4f3ef46cfe4a8bd81be47181d36d8c9d67f7 +archive checksum: f0a2a6b295e6d6c6f186dc0d2f80b0daf5796b8f8dbf1f70dd60e475e6d4a2ad +directory: ../../../../tmp/pb-template-integration-r37VjQ/atelier-solopreneur-1.3.2 +archive: ../../../../tmp/pb-template-integration-r37VjQ/atelier-solopreneur-1.3.2.tar.gz + +> @personal-brand/api@ db:seed /home/que01/Project/persionalBrand/apps/api +> tsx prisma/seed.ts + + +> @personal-brand/api@ db:seed /home/que01/Project/persionalBrand/apps/api +> tsx prisma/seed.ts + +Seed idempotency verified: content, forms and release history preserved +TAP version 13 +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [NestFactory] Starting Nest application... +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] HealthModule dependencies initialized +23ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] AppModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] InfrastructureModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] BookingModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] PublicModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] TenantModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] SessionModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] CustomerModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [InstanceLoader] AdminModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicController {/public}: +8ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/brand, GET} route +2ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicTrustContentController {/public/trust-content}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/trust-content, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicTemplateController {/public/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/templates, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/templates/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/templates/:key, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicWorkspaceController {/public/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicOfferingController {/public/offerings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/offerings/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] PublicInquiryFormController {/public/inquiry-forms}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/public/inquiry-forms/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] CustomerInquirySubmissionController {/customer/inquiry-submissions}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] CustomerBookingController {/customer/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/bookings, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/bookings/:id/cancel, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/customer/session/wechat, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminSessionController {/admin/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/session/login, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/session/current, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/session/change-password, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] TenantController {/admin/brands}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands/creation-options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands/members, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands/members, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands/members/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/brands/:brandId/switch, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminWorkspacePreviewController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/install, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/select-version, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminTemplateController {/admin/workspace}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/upgrade, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/rollback, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminCapabilityController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities/:key, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminOfferingController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminInquiryController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminConfigController {/admin/config}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/brand, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/brand, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/presentation, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminReleaseController {/admin/releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/releases/readiness, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/releases/publish, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/releases/:version/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/releases/revoke, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminMiniAppReleaseController {/admin/miniapp-releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/latest, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/upload, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/status, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/uploads/config, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/uploads/presign, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminLocalUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/uploads/local, PUT} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminBookingController {/admin/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/unread-count, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/status, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/read, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] AdminTemplatePackageController {/admin/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/retire, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/audit, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] TemplateOperationMetricsController {/admin/template-operations}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/admin/template-operations/failures, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RoutesResolver] HealthController {/health}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [RouterExplorer] Mapped {/health, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:22 PM LOG [NestApplication] Nest application successfully started +3ms +# Subtest: 模板目录只允许平台模板管理员访问,并支持安全、幂等导入 +ok 1 - 模板目录只允许平台模板管理员访问,并支持安全、幂等导入 + --- + duration_ms: 1046.928695 + type: 'test' + ... +# Subtest: 模板失败指标仅平台模板管理员可查,按窗口聚合且不暴露操作内容 +ok 2 - 模板失败指标仅平台模板管理员可查,按窗口聚合且不暴露操作内容 + --- + duration_ms: 302.869173 + type: 'test' + ... +# Subtest: 平台模板管理员可以按行业预览版本,且预览不写入品牌数据 +ok 3 - 平台模板管理员可以按行业预览版本,且预览不写入品牌数据 + --- + duration_ms: 1306.742471 + type: 'test' + ... +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [NestFactory] Starting Nest application... +2488ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] HealthModule dependencies initialized +9ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] AppModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] InfrastructureModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] BookingModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] PublicModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] TenantModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] SessionModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] CustomerModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [InstanceLoader] AdminModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicController {/api/public}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/brand, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicTrustContentController {/api/public/trust-content}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicTemplateController {/api/public/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/templates, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/templates/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/templates/:key, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicWorkspaceController {/api/public/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicOfferingController {/api/public/offerings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/offerings/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] PublicInquiryFormController {/api/public/inquiry-forms}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/public/inquiry-forms/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] CustomerInquirySubmissionController {/api/customer/inquiry-submissions}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/inquiry-submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/inquiry-submissions/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/inquiry-submissions, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] CustomerBookingController {/api/customer/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/bookings, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/bookings/:id/cancel, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] CustomerSessionController {/api/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] CustomerSessionController {/api/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/customer/session/wechat, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminSessionController {/api/admin/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/session/login, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/session/current, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/session/change-password, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] TenantController {/api/admin/brands}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands/creation-options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands, POST} route +4ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands/members, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands/members, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands/members/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/brands/:brandId/switch, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminWorkspacePreviewController {/api/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/install, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/template/select-version, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminTemplateController {/api/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/template/options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/template/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/template/upgrade, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/template/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminCapabilityController {/api/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/capabilities, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/sample-content/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/sample-content/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/capabilities/:key, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminOfferingController {/api/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/offerings, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/offerings/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/offerings/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminInquiryController {/api/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/fields, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/fields/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/fields/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/forms, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/submissions/:id, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/forms, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/workspace/forms/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminConfigController {/api/admin/config}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/brand, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/brand, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/presentation, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/trust-content, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/trust-content/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/config/trust-content/:id, DELETE} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminReleaseController {/api/admin/releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/releases/readiness, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/releases/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/releases/:version/rollback, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/releases/revoke, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminMiniAppReleaseController {/api/admin/miniapp-releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases/latest, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases/settings, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases/settings, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases/:id/upload, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/miniapp-releases/:id/status, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminUploadController {/api/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/uploads/config, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/uploads/presign, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminLocalUploadController {/api/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/uploads/local, PUT} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminBookingController {/api/admin/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/unread-count, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/:id/status, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/:id/read, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/:id/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/tags, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/bookings/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] AdminTemplatePackageController {/api/admin/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates/import, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates/:id/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates/:id/retire, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates/:id/audit, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/templates/:id/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] TemplateOperationMetricsController {/api/admin/template-operations}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/admin/template-operations/failures, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RoutesResolver] HealthController {/api/health}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [RouterExplorer] Mapped {/api/health, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:25 PM LOG [NestApplication] Nest application successfully started +1ms +# Subtest: admin routes remain guarded when an API prefix is configured +ok 4 - admin routes remain guarded when an API prefix is configured + --- + duration_ms: 336.408363 + type: 'test' + ... +# Subtest: miniapp release tasks are authorized, idempotent, and state checked +ok 5 - miniapp release tasks are authorized, idempotent, and state checked + --- + duration_ms: 340.249841 + type: 'test' + ... +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [NestFactory] Starting Nest application... +656ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] HealthModule dependencies initialized +8ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] AppModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] InfrastructureModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] BookingModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] PublicModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] TenantModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] SessionModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] CustomerModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [InstanceLoader] AdminModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicController {/public}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/brand, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicTrustContentController {/public/trust-content}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicTemplateController {/public/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/templates, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/templates/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/templates/:key, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicWorkspaceController {/public/workspace}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicOfferingController {/public/offerings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/offerings/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] PublicInquiryFormController {/public/inquiry-forms}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/public/inquiry-forms/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] CustomerInquirySubmissionController {/customer/inquiry-submissions}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] CustomerBookingController {/customer/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/bookings, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/bookings/:id/cancel, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/customer/session/wechat, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminSessionController {/admin/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/session/login, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/session/current, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/session/change-password, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] TenantController {/admin/brands}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands/creation-options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands/members, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands/members, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands/members/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/brands/:brandId/switch, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminWorkspacePreviewController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/install, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/select-version, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminTemplateController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/upgrade, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminCapabilityController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities/:key, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminOfferingController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminInquiryController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, DELETE} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminConfigController {/admin/config}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/brand, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/brand, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/presentation, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminReleaseController {/admin/releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/releases/readiness, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/releases/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/releases/:version/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/releases/revoke, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminMiniAppReleaseController {/admin/miniapp-releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/latest, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/upload, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/status, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/uploads/config, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/uploads/presign, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminLocalUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/uploads/local, PUT} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminBookingController {/admin/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/unread-count, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/status, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/read, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/tags, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] AdminTemplatePackageController {/admin/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/publish, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/retire, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/audit, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] TemplateOperationMetricsController {/admin/template-operations}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/admin/template-operations/failures, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RoutesResolver] HealthController {/health}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [RouterExplorer] Mapped {/health, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:26 PM LOG [NestApplication] Nest application successfully started +1ms +# Subtest: API restart recovers an expired persisted miniapp build attempt +ok 6 - API restart recovers an expired persisted miniapp build attempt + --- + duration_ms: 87.189813 + type: 'test' + ... +# Subtest: miniapp release settings never expose or persist plaintext private keys +ok 7 - miniapp release settings never expose or persist plaintext private keys + --- + duration_ms: 305.471981 + type: 'test' + ... +# Subtest: real template declarations persist brand offering and trust bindings through draft and publication +ok 8 - real template declarations persist brand offering and trust bindings through draft and publication + --- + duration_ms: 489.272815 + type: 'test' + ... +# Validated 193 manifest bindings through persistence draft and publication +# Subtest: food structured edits survive publication and reach the generated page slots +ok 9 - food structured edits survive publication and reach the generated page slots + --- + duration_ms: 210.233582 + type: 'test' + ... +# Subtest: admin release lifecycle is authorized, brand-scoped, and versioned +ok 10 - admin release lifecycle is authorized, brand-scoped, and versioned + --- + duration_ms: 1195.941628 + type: 'test' + ... +# Subtest: health and public content are available without authentication +ok 11 - health and public content are available without authentication + --- + duration_ms: 34.795494 + type: 'test' + ... +# Subtest: visual template compatibility is enforced by catalog, preview, and version selection +ok 12 - visual template compatibility is enforced by catalog, preview, and version selection + --- + duration_ms: 274.962982 + type: 'test' + ... +# Subtest: industry template state has a single source of truth +ok 13 - industry template state has a single source of truth + --- + duration_ms: 301.500828 + type: 'test' + ... +# Subtest: seeded public workspaces keep personal, food, and doors brands isolated +ok 14 - seeded public workspaces keep personal, food, and doors brands isolated + --- + duration_ms: 11.209543 + type: 'test' + ... +# Subtest: brand creation options are owner-scoped +ok 15 - brand creation options are owner-scoped + --- + duration_ms: 283.266897 + type: 'test' + ... +# Subtest: owner can create an isolated brand +ok 16 - owner can create an isolated brand + --- + duration_ms: 361.74652 + type: 'test' + ... +# Subtest: page scheme options are readable by owners and admins only +ok 17 - page scheme options are readable by owners and admins only + --- + duration_ms: 290.807356 + type: 'test' + ... +# Subtest: public workspace uses brand-scoped capability installations and preserves status +ok 18 - public workspace uses brand-scoped capability installations and preserves status + --- + duration_ms: 356.048068 + type: 'test' + ... +# Subtest: admin can update declared capability status with authorization and audit +ok 19 - admin can update declared capability status with authorization and audit + --- + duration_ms: 274.252004 + type: 'test' + ... +# Subtest: editor membership can manage brand content but cannot change system settings +ok 20 - editor membership can manage brand content but cannot change system settings + --- + duration_ms: 277.762199 + type: 'test' + ... +# Subtest: owner can manage brand members without removing the final owner +ok 21 - owner can manage brand members without removing the final owner + --- + duration_ms: 547.717969 + type: 'test' + ... +# Subtest: manually created member must change the initial password before normal use +ok 22 - manually created member must change the initial password before normal use + --- + duration_ms: 1562.477579 + type: 'test' + ... +# Subtest: admin can install optional quote capability without industry-specific branching +ok 23 - admin can install optional quote capability without industry-specific branching + --- + duration_ms: 639.651868 + type: 'test' + ... +# Subtest: admin capability list includes template defaults and brand overrides +ok 24 - admin capability list includes template defaults and brand overrides + --- + duration_ms: 269.140296 + type: 'test' + ... +# Subtest: installing another industry template is rejected without drifting brand identity +ok 25 - installing another industry template is rejected without drifting brand identity + --- + duration_ms: 290.423984 + type: 'test' + ... +# Subtest: cross template requests are rejected without creating a drifted installation +ok 26 - cross template requests are rejected without creating a drifted installation + --- + duration_ms: 290.92667 + type: 'test' + ... +# Subtest: admin can preview and import sample content idempotently +ok 27 - admin can preview and import sample content idempotently + --- + duration_ms: 320.598873 + type: 'test' + ... +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [NestFactory] Starting Nest application... +9218ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] HealthModule dependencies initialized +7ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] AppModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] InfrastructureModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] BookingModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] PublicModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] TenantModule dependencies initialized +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] SessionModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] WorkspaceModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] CustomerModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [InstanceLoader] AdminModule dependencies initialized +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicController {/public}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/brand, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicTrustContentController {/public/trust-content}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicTemplateController {/public/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/templates, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/templates/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/templates/:key, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicWorkspaceController {/public/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicOfferingController {/public/offerings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/offerings, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/offerings/:id, GET} route +4ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] PublicInquiryFormController {/public/inquiry-forms}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/public/inquiry-forms/:id, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] CustomerInquirySubmissionController {/customer/inquiry-submissions}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/inquiry-submissions, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] CustomerBookingController {/customer/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/bookings, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/bookings/:id/cancel, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] CustomerSessionController {/customer/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/customer/session/wechat, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminSessionController {/admin/session}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/session/login, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/session/current, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/session/logout, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/session/change-password, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] TenantController {/admin/brands}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands/creation-options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands/members, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands/members, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands/members/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/brands/:brandId/switch, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminWorkspacePreviewController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/install, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/select-version, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminTemplateController {/admin/workspace}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/options, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/upgrade, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/template/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminCapabilityController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/preview, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/sample-content/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/capabilities/:key, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminOfferingController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/offerings/:id, DELETE} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminInquiryController {/admin/workspace}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/fields/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/submissions/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/workspace/forms/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminConfigController {/admin/config}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/brand, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/brand, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/presentation, PATCH} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/config/trust-content/:id, DELETE} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminReleaseController {/admin/releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/releases/readiness, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/releases/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/releases/:version/rollback, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/releases/revoke, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminMiniAppReleaseController {/admin/miniapp-releases}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/latest, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/settings, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases, POST} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/upload, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/miniapp-releases/:id/status, PATCH} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/uploads/config, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/uploads/presign, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminLocalUploadController {/admin/uploads}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/uploads/local, PUT} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminBookingController {/admin/bookings}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/unread-count, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/status, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/read, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/:id/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/bookings/tags, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] AdminTemplatePackageController {/admin/templates}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates, GET} route +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates/import, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/publish, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/retire, POST} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/audit, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/templates/:id/preview, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] TemplateOperationMetricsController {/admin/template-operations}: +1ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/admin/template-operations/failures, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RoutesResolver] HealthController {/health}: +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [RouterExplorer] Mapped {/health, GET} route +0ms +# [Nest] 333103 - 10/20/2026, 5:00:35 PM LOG [NestApplication] Nest application successfully started +1ms +# Subtest: template ledger install, upgrade preview, and rollback stay brand-scoped +ok 28 - template ledger install, upgrade preview, and rollback stay brand-scoped + --- + duration_ms: 813.640899 + type: 'test' + ... +# Subtest: admin preview workspace is authorized and brand-scoped draft runtime +ok 29 - admin preview workspace is authorized and brand-scoped draft runtime + --- + duration_ms: 49.184379 + type: 'test' + ... +# Subtest: admin can customize workspace fields with brand isolation +ok 30 - admin can customize workspace fields with brand isolation + --- + duration_ms: 287.974465 + type: 'test' + ... +# Subtest: selected package version is reflected in public runtime workspace +ok 31 - selected package version is reflected in public runtime workspace + --- + duration_ms: 293.112363 + type: 'test' + ... +# Subtest: legacy doors installation preview separates content package and platform renderer versions +ok 32 - legacy doors installation preview separates content package and platform renderer versions + --- + duration_ms: 84.173728 + type: 'test' + ... +# Subtest: public workspace exposes declared brand and trust presentation data +ok 33 - public workspace exposes declared brand and trust presentation data + --- + duration_ms: 24.882892 + type: 'test' + ... +# Subtest: edited template facts reach public workspace only after publication +ok 34 - edited template facts reach public workspace only after publication + --- + duration_ms: 253.257309 + type: 'test' + ... +# Subtest: admin can create and version an inquiry form +ok 35 - admin can create and version an inquiry form + --- + duration_ms: 753.808534 + type: 'test' + ... +# Subtest: admin workspace data stays inside the acting brand +ok 36 - admin workspace data stays inside the acting brand + --- + duration_ms: 290.535183 + type: 'test' + ... +# Subtest: inquiry form offering link is validated against the brand +ok 37 - inquiry form offering link is validated against the brand + --- + duration_ms: 301.914075 + type: 'test' + ... +# Subtest: release readiness explains a form whose offering was disabled +ok 38 - release readiness explains a form whose offering was disabled + --- + duration_ms: 277.148373 + type: 'test' + ... +# Subtest: admin rejects invalid dynamic inquiry field definitions +ok 39 - admin rejects invalid dynamic inquiry field definitions + --- + duration_ms: 265.068092 + type: 'test' + ... +# Subtest: admin can manage offerings and public endpoint hides disabled offerings +ok 40 - admin can manage offerings and public endpoint hides disabled offerings + --- + duration_ms: 335.286731 + type: 'test' + ... +# Subtest: offering with an inquiry form cannot be deleted +ok 41 - offering with an inquiry form cannot be deleted + --- + duration_ms: 272.487684 + type: 'test' + ... +# Subtest: admin booking endpoints reject missing or customer credentials +ok 42 - admin booking endpoints reject missing or customer credentials + --- + duration_ms: 1.617063 + type: 'test' + ... +# Subtest: seeded admin can log in and read protected booking resources +ok 43 - seeded admin can log in and read protected booking resources + --- + duration_ms: 271.223114 + type: 'test' + ... +# Subtest: admin login validates credentials +ok 44 - admin login validates credentials + --- + duration_ms: 245.480043 + type: 'test' + ... +# Subtest: admin logout revokes the current token +ok 45 - admin logout revokes the current token + --- + duration_ms: 536.131485 + type: 'test' + ... +# Subtest: customer logout revokes the current token +ok 46 - customer logout revokes the current token + --- + duration_ms: 9.989167 + type: 'test' + ... +# Subtest: admin session cookie drives current session and rejects invalid credentials +ok 47 - admin session cookie drives current session and rejects invalid credentials + --- + duration_ms: 534.050138 + type: 'test' + ... +# Subtest: admin login does not auto-grant ownership to users without memberships +ok 48 - admin login does not auto-grant ownership to users without memberships + --- + duration_ms: 540.772709 + type: 'test' + ... +# Subtest: changing an admin password revokes existing admin tokens +ok 49 - changing an admin password revokes existing admin tokens + --- + duration_ms: 1038.46864 + type: 'test' + ... +# Subtest: admin can list and switch only enabled brand memberships +ok 50 - admin can list and switch only enabled brand memberships + --- + duration_ms: 291.002993 + type: 'test' + ... +# Subtest: brand switching isolates admin configuration, offerings, and public workspace +ok 51 - brand switching isolates admin configuration, offerings, and public workspace + --- + duration_ms: 301.675225 + type: 'test' + ... +# Subtest: disabled brand membership blocks existing admin token +ok 52 - disabled brand membership blocks existing admin token + --- + duration_ms: 274.255029 + type: 'test' + ... +# Subtest: admin can read and update brand and service configuration +ok 53 - admin can read and update brand and service configuration + --- + duration_ms: 302.165417 + type: 'test' + ... +# Subtest: admin can update user-facing brand presentation without replacing other config +ok 54 - admin can update user-facing brand presentation without replacing other config + --- + duration_ms: 276.291841 + type: 'test' + ... +# Subtest: admin can manage trust content +ok 55 - admin can manage trust content + --- + duration_ms: 313.748012 + type: 'test' + ... +# Subtest: customer booking endpoints require a valid customer session +ok 56 - customer booking endpoints require a valid customer session + --- + duration_ms: 6.235904 + type: 'test' + ... +# Subtest: wechat login validates the request DTO before exchanging the code +ok 57 - wechat login validates the request DTO before exchanging the code + --- + duration_ms: 0.758407 + type: 'test' + ... +# Subtest: wechat login creates a customer session for the requested brand +ok 58 - wechat login creates a customer session for the requested brand + --- + duration_ms: 7.035047 + type: 'test' + ... +# Subtest: customer booking DTO rejects incomplete package requests +ok 59 - customer booking DTO rejects incomplete package requests + --- + duration_ms: 7.882362 + type: 'test' + ... +# Subtest: customer can create a generic inquiry without food-specific fields +ok 60 - customer can create a generic inquiry without food-specific fields + --- + duration_ms: 13.786992 + type: 'test' + ... +# Subtest: customer can create and cancel a package booking +ok 61 - customer can create and cancel a package booking + --- + duration_ms: 31.412157 + type: 'test' + ... +# Subtest: admin can advance booking status but cannot skip the state machine +ok 62 - admin can advance booking status but cannot skip the state machine + --- + duration_ms: 284.918293 + type: 'test' + ... +# Subtest: admin can inspect booking follow-up and tags +ok 63 - admin can inspect booking follow-up and tags + --- + duration_ms: 299.644132 + type: 'test' + ... +# Subtest: admin upload endpoints authorize and persist local media +ok 64 - admin upload endpoints authorize and persist local media + --- + duration_ms: 270.694228 + type: 'test' + ... +# Subtest: atelier template imports selected package and preserves draft publication isolation +ok 65 - atelier template imports selected package and preserves draft publication isolation + --- + duration_ms: 701.786413 + type: 'test' + ... +1..65 +# tests 65 +# suites 0 +# pass 65 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 23474.922972 +TAP version 13 +# Subtest: upload presign DTO rejects unsupported media type and oversized names +ok 1 - upload presign DTO rejects unsupported media type and oversized names + --- + duration_ms: 139.443597 + type: 'test' + ... +# Subtest: local upload presign targets the API route and requires brand access +ok 2 - local upload presign targets the API route and requires brand access + --- + duration_ms: 240.864418 + type: 'test' + ... +1..2 +# tests 2 +# suites 0 +# pass 2 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 547.875072 diff --git a/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log new file mode 100644 index 0000000..d4c4bd7 --- /dev/null +++ b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20-final/api-unit.log @@ -0,0 +1,440 @@ + +> @personal-brand/api@ test /home/que01/Project/persionalBrand/apps/api +> tsx --test test/**/*.test.ts + +TAP version 13 +# Subtest: 构建 worker 异常退出时返回明确非零结果 +ok 1 - 构建 worker 异常退出时返回明确非零结果 + --- + duration_ms: 80.679734 + type: 'test' + ... +# Subtest: 构建 worker watchdog 超时会终止子进程并返回 timedOut +ok 2 - 构建 worker watchdog 超时会终止子进程并返回 timedOut + --- + duration_ms: 36.587105 + type: 'test' + ... +# Subtest: 构建进度更新不触发发布状态机的顺序校验 +ok 3 - 构建进度更新不触发发布状态机的顺序校验 + --- + duration_ms: 1.684099 + type: 'test' + ... +# Subtest: 构建进度更新按品牌隔离,任务不存在时抛出 404 +ok 4 - 构建进度更新按品牌隔离,任务不存在时抛出 404 + --- + duration_ms: 0.989713 + type: 'test' + ... +# Subtest: 重新构建时可以清除上一次遗留的错误信息 +ok 5 - 重新构建时可以清除上一次遗留的错误信息 + --- + duration_ms: 0.32377 + type: 'test' + ... +# Subtest: 发布状态机仍拒绝越级变更并允许合法上传流转 +ok 6 - 发布状态机仍拒绝越级变更并允许合法上传流转 + --- + duration_ms: 0.879665 + type: 'test' + ... +# Subtest: 失败任务重试时可回到 built 并清除错误 +ok 7 - 失败任务重试时可回到 built 并清除错误 + --- + duration_ms: 0.423466 + type: 'test' + ... +# Subtest: settings presentation never exposes plaintext credentials +ok 8 - settings presentation never exposes plaintext credentials + --- + duration_ms: 2.507469 + type: 'test' + ... +# Subtest: update validates URL and private key before persistence +ok 9 - update validates URL and private key before persistence + --- + duration_ms: 2.477873 + type: 'test' + ... +# Subtest: update encrypts a valid private key and preserves existing settings +ok 10 - update encrypts a valid private key and preserves existing settings + --- + duration_ms: 2.609961 + type: 'test' + ... +# Subtest: upload blocks a currently building task before credentials are read +ok 11 - upload blocks a currently building task before credentials are read + --- + duration_ms: 2.803565 + type: 'test' + ... +# Subtest: upload rejects invalid app configuration before building +ok 12 - upload rejects invalid app configuration before building + --- + duration_ms: 0.739001 + type: 'test' + ... +# Subtest: failed build records logs and build failure state +ok 13 - failed build records logs and build failure state + --- + duration_ms: 11.162244 + type: 'test' + ... +# Subtest: missing artifact records build failure without invoking upload +ok 14 - missing artifact records build failure without invoking upload + --- + duration_ms: 1.657659 + type: 'test' + ... +# Subtest: upload rejects missing credentials before build +ok 15 - upload rejects missing credentials before build + --- + duration_ms: 0.580422 + type: 'test' + ... +# Subtest: local mode reports configuration and returns a relative local upload URL +ok 16 - local mode reports configuration and returns a relative local upload URL + --- + duration_ms: 19.254692 + type: 'test' + ... +# Subtest: upload service validates media type and traversal keys before persistence +ok 17 - upload service validates media type and traversal keys before persistence + --- + duration_ms: 5.35153 + type: 'test' + ... +# Subtest: refactored admin controllers preserve their declared API routes +ok 18 - refactored admin controllers preserve their declared API routes + --- + duration_ms: 2.171245 + type: 'test' + ... +# Subtest: root module composes bounded feature modules only +ok 19 - root module composes bounded feature modules only + --- + duration_ms: 0.224672 + type: 'test' + ... +# Subtest: 创建普通套餐订单时保存价格快照和预计金额 +ok 20 - 创建普通套餐订单时保存价格快照和预计金额 + --- + duration_ms: 3.15675 + type: 'test' + ... +# Subtest: 普通套餐不能在没有明细时创建 +ok 21 - 普通套餐不能在没有明细时创建 + --- + duration_ms: 1.103406 + type: 'test' + ... +# Subtest: 客户只能取消自己的 received 订单 +ok 22 - 客户只能取消自己的 received 订单 + --- + duration_ms: 0.528334 + type: 'test' + ... +# Subtest: 取消不存在或不属于当前客户的订单返回不存在 +ok 23 - 取消不存在或不属于当前客户的订单返回不存在 + --- + duration_ms: 0.329831 + type: 'test' + ... +# Subtest: 订单状态只能按定义的状态机流转 +ok 24 - 订单状态只能按定义的状态机流转 + --- + duration_ms: 0.789666 + type: 'test' + ... +# Subtest: 更新订单标签时拒绝其他品牌的标签 +ok 25 - 更新订单标签时拒绝其他品牌的标签 + --- + duration_ms: 0.44106 + type: 'test' + ... +# Subtest: 开发 seed 引用的本地媒体都有随仓库分发的源文件 +ok 26 - 开发 seed 引用的本地媒体都有随仓库分发的源文件 + --- + duration_ms: 1.65813 + type: 'test' + ... +# Subtest: 小程序产物根目录锚定仓库根目录,不随 API 进程工作目录变化 +ok 27 - 小程序产物根目录锚定仓库根目录,不随 API 进程工作目录变化 + --- + duration_ms: 1.317639 + type: 'test' + ... +# Subtest: 按模板包 key 生成唯一的微信小程序产物目录 +ok 28 - 按模板包 key 生成唯一的微信小程序产物目录 + --- + duration_ms: 0.275849 + type: 'test' + ... +# Subtest: 显式配置的产物根目录按仓库根目录解析相对路径 +ok 29 - 显式配置的产物根目录按仓库根目录解析相对路径 + --- + duration_ms: 0.170942 + type: 'test' + ... +# Subtest: 发布产物路径隔离品牌、模板版本和 attempt +ok 30 - 发布产物路径隔离品牌、模板版本和 attempt + --- + duration_ms: 0.400984 + type: 'test' + ... +# Subtest: 发布产物路径拒绝可能越界的品牌或模板字段 +ok 31 - 发布产物路径拒绝可能越界的品牌或模板字段 + --- + duration_ms: 0.578859 + type: 'test' + ... +# Subtest: 后台配置的请求地址优先于环境变量,改域名不需要动服务端配置 +ok 32 - 后台配置的请求地址优先于环境变量,改域名不需要动服务端配置 + --- + duration_ms: 1.515873 + type: 'test' + ... +# Subtest: 后台地址允许带路径前缀,保存前会去掉结尾斜杠 +ok 33 - 后台地址允许带路径前缀,保存前会去掉结尾斜杠 + --- + duration_ms: 0.593416 + type: 'test' + ... +# Subtest: 优先使用 MINIAPP_API_BASE_URL,去掉结尾斜杠 +ok 34 - 优先使用 MINIAPP_API_BASE_URL,去掉结尾斜杠 + --- + duration_ms: 0.192292 + type: 'test' + ... +# Subtest: 没有显式配置时由 PUBLIC_BASE_URL 加默认 /api 推导 +ok 35 - 没有显式配置时由 PUBLIC_BASE_URL 加默认 /api 推导 + --- + duration_ms: 0.18611 + type: 'test' + ... +# Subtest: 非 https 的公网地址必须被拒绝,避免再次打出 localhost 包 +ok 36 - 非 https 的公网地址必须被拒绝,避免再次打出 localhost 包 + --- + duration_ms: 0.437694 + type: 'test' + ... +# Subtest: 本地调试地址允许 http,方便开发环境构建 +ok 37 - 本地调试地址允许 http,方便开发环境构建 + --- + duration_ms: 0.195187 + type: 'test' + ... +# Subtest: AppID 取品牌配置优先,回落 WEAPP_APP_ID,并拒绝占位值 +ok 38 - AppID 取品牌配置优先,回落 WEAPP_APP_ID,并拒绝占位值 + --- + duration_ms: 0.381347 + type: 'test' + ... +# Subtest: 构建中的任务在超过阈值未更新时视为已中断 +ok 39 - 构建中的任务在超过阈值未更新时视为已中断 + --- + duration_ms: 1.370659 + type: 'test' + ... +# Subtest: 非 building 状态永远不算中断,避免误伤正常流程 +ok 40 - 非 building 状态永远不算中断,避免误伤正常流程 + --- + duration_ms: 0.278604 + type: 'test' + ... +# Subtest: 时间戳异常时按未中断处理,宁可挡住重试也不允许并发构建 +ok 41 - 时间戳异常时按未中断处理,宁可挡住重试也不允许并发构建 + --- + duration_ms: 0.20209 + type: 'test' + ... +# Subtest: 阈值可通过环境变量覆盖,非法值回退到默认 30 分钟 +ok 42 - 阈值可通过环境变量覆盖,非法值回退到默认 30 分钟 + --- + duration_ms: 0.285577 + type: 'test' + ... +# Subtest: 构建超时阈值支持环境变量并有独立默认值 +ok 43 - 构建超时阈值支持环境变量并有独立默认值 + --- + duration_ms: 0.203984 + type: 'test' + ... +# Subtest: CommonJS 形态的 miniprogram-ci 从 default 上取 Project 与 upload +ok 44 - CommonJS 形态的 miniprogram-ci 从 default 上取 Project 与 upload + --- + duration_ms: 1.180822 + type: 'test' + ... +# Subtest: 已是命名导出的模块可以直接使用 +ok 45 - 已是命名导出的模块可以直接使用 + --- + duration_ms: 0.218942 + type: 'test' + ... +# Subtest: 缺少 Project 或 upload 时抛出明确错误,而不是 undefined is not a constructor +ok 46 - 缺少 Project 或 upload 时抛出明确错误,而不是 undefined is not a constructor + --- + duration_ms: 0.67514 + type: 'test' + ... +# Subtest: 单行私钥(换行被输入框吞掉)可以还原为合法 PEM 并恢复签名能力 +ok 47 - 单行私钥(换行被输入框吞掉)可以还原为合法 PEM 并恢复签名能力 + --- + duration_ms: 46.62352 + type: 'test' + ... +# Subtest: 字面量 \\n 转义的私钥同样可以还原 +ok 48 - 字面量 \\n 转义的私钥同样可以还原 + --- + duration_ms: 35.171352 + type: 'test' + ... +# Subtest: 规范化是幂等的,不会反复改写已正确的 PEM +ok 49 - 规范化是幂等的,不会反复改写已正确的 PEM + --- + duration_ms: 93.585148 + type: 'test' + ... +# Subtest: 损坏或非 PEM 内容会被判定为无效,而不是静默保存 +ok 50 - 损坏或非 PEM 内容会被判定为无效,而不是静默保存 + --- + duration_ms: 45.896122 + type: 'test' + ... +# Subtest: 同一任务同一阶段的有效 lease 拒绝并发操作 +ok 51 - 同一任务同一阶段的有效 lease 拒绝并发操作 + --- + duration_ms: 2.956083 + type: 'test' + ... +# Subtest: 过期 lease 会先收敛为 timed_out,再允许新的 attempt 接管 +ok 52 - 过期 lease 会先收敛为 timed_out,再允许新的 attempt 接管 + --- + duration_ms: 0.652408 + type: 'test' + ... +# Subtest: 服务进程重建后从持久化记录恢复,并接管已过期的 build attempt +ok 53 - 服务进程重建后从持久化记录恢复,并接管已过期的 build attempt + --- + duration_ms: 0.790237 + type: 'test' + ... +# Subtest: heartbeat 遇到过期上传 lease 时将任务阶段收敛为 timed_out +ok 54 - heartbeat 遇到过期上传 lease 时将任务阶段收敛为 timed_out + --- + duration_ms: 0.830002 + type: 'test' + ... +# Subtest: 错误 lease 不能结束操作,正确 lease 结束上传后更新阶段状态 +ok 55 - 错误 lease 不能结束操作,正确 lease 结束上传后更新阶段状态 + --- + duration_ms: 0.85031 + type: 'test' + ... +# Subtest: heartbeat 续租并更新日志,结束后的 attempt 拒绝迟到 heartbeat +ok 56 - heartbeat 续租并更新日志,结束后的 attempt 拒绝迟到 heartbeat + --- + duration_ms: 1.451821 + type: 'test' + ... +# Subtest: 执行结束时 lease 已过期会持久化 timed_out,而不是回滚为 running +ok 57 - 执行结束时 lease 已过期会持久化 timed_out,而不是回滚为 running + --- + duration_ms: 0.48344 + type: 'test' + ... +# Subtest: 上传工作目录位于系统临时目录,不会落在仓库内 +ok 58 - 上传工作目录位于系统临时目录,不会落在仓库内 + --- + duration_ms: 1.278095 + type: 'test' + ... +# Subtest: miniprogram-ci 的相对路径缓存目录落在临时工作目录而不是仓库 +ok 59 - miniprogram-ci 的相对路径缓存目录落在临时工作目录而不是仓库 + --- + duration_ms: 889.708804 + type: 'test' + ... +# Subtest: 上传会在临时工作目录下启动,失败也不会在仓库留下目录 +ok 60 - 上传会在临时工作目录下启动,失败也不会在仓库留下目录 + --- + duration_ms: 35.854056 + type: 'test' + ... +# Subtest: 上传在独立进程执行,失败时返回可读错误且不抛出未捕获异常 +ok 61 - 上传在独立进程执行,失败时返回可读错误且不抛出未捕获异常 + --- + duration_ms: 64.635283 + type: 'test' + ... +# Subtest: 上传超时会终止子进程并返回明确错误 +ok 62 - 上传超时会终止子进程并返回明确错误 + --- + duration_ms: 5.145082 + type: 'test' + ... +# Subtest: miniprogram-ci compatibility patches keep overridden runtime APIs usable +ok 63 - miniprogram-ci compatibility patches keep overridden runtime APIs usable + --- + duration_ms: 681.182262 + type: 'test' + ... +# Subtest: public default brand context fails fast when configuration is missing +ok 64 - public default brand context fails fast when configuration is missing + --- + duration_ms: 2.103899 + type: 'test' + ... +# Subtest: every API route has an explicit authorization and success coverage contract +ok 65 - every API route has an explicit authorization and success coverage contract + --- + duration_ms: 503.725354 + type: 'test' + ... +# Subtest: preview resources verify raster content and diagnose invalid or oversized assets +ok 66 - preview resources verify raster content and diagnose invalid or oversized assets + --- + duration_ms: 84.808494 + type: 'test' + ... +# Subtest: preview resources reject image checksum drift and unavailable archives +ok 67 - preview resources reject image checksum drift and unavailable archives + --- + duration_ms: 63.867568 + type: 'test' + ... +# Subtest: template preview matrix discovers newly added package manifests +ok 68 - template preview matrix discovers newly added package manifests + --- + duration_ms: 14.07272 + type: 'test' + ... +# Subtest: template preview matrix keeps every deployed package, industry, and version isolated +ok 69 - template preview matrix keeps every deployed package, industry, and version isolated + --- + duration_ms: 923.427842 + type: 'test' + ... +# Subtest: 模板版本按 SemVer 而不是导入时间判断最新版 +ok 70 - 模板版本按 SemVer 而不是导入时间判断最新版 + --- + duration_ms: 1.899655 + type: 'test' + ... +# Subtest: 模板版本排序正确处理预发布版本和同版本稳定性 +ok 71 - 模板版本排序正确处理预发布版本和同版本稳定性 + --- + duration_ms: 0.468962 + type: 'test' + ... +1..71 +# tests 71 +# suites 0 +# pass 71 +# fail 0 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 2561.461139 diff --git a/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log new file mode 100644 index 0000000..10b6b53 --- /dev/null +++ b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/admin-editor.log @@ -0,0 +1,11 @@ + +Running 2 tests using 1 worker + +(node:297051) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) +(node:297051) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) + ✓ 1 test/browser/admin-editor.spec.ts:235:1 › Admin 按通用预览目标筛选字段并同步品牌草稿 (22.4s) + ✓ 2 test/browser/admin-editor.spec.ts:654:1 › 林境模板支持首页和主理人区域点选 (22.9s) + + 2 passed (46.2s) diff --git a/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log new file mode 100644 index 0000000..cd860f3 --- /dev/null +++ b/.codex-tasks/template-audit-execution/raw/evidence-2026-10-20/template-preview-media.log @@ -0,0 +1,16 @@ + +Running 1 test using 1 worker + +(node:297457) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) +(node:297457) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) +(node:297554) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) +(node:297665) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) +(node:297714) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. +(Use `node --trace-warnings ...` to show where the warning was created) + ✓ 1 test/browser/template-preview-media.spec.ts:154:1 › 导入包预览矩阵展示身份、资源和完整媒体槽位 (7.0s) + + 1 passed (7.9s) diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-320.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-320.png new file mode 100644 index 0000000..7433cc2 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-320.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-375.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-375.png new file mode 100644 index 0000000..458a877 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-375.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-390.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-390.png new file mode 100644 index 0000000..e0dfbed Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/01-acheng-campus-food-food-390.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-320.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-320.png new file mode 100644 index 0000000..1925af3 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-320.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-375.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-375.png new file mode 100644 index 0000000..6f5a2a5 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-375.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-390.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-390.png new file mode 100644 index 0000000..7392b91 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/02-atelier-solopreneur-personal-390.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-320.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-320.png new file mode 100644 index 0000000..b1b292d Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-320.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-375.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-375.png new file mode 100644 index 0000000..1bbac04 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-375.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-390.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-390.png new file mode 100644 index 0000000..e50bf4d Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/03-linjing-editorial-doors-390.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-01-acheng-campus-food-food.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-01-acheng-campus-food-food.png new file mode 100644 index 0000000..2760662 Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-01-acheng-campus-food-food.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-02-atelier-solopreneur-personal.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-02-atelier-solopreneur-personal.png new file mode 100644 index 0000000..43d323b Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-02-atelier-solopreneur-personal.png differ diff --git a/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-03-linjing-editorial-doors.png b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-03-linjing-editorial-doors.png new file mode 100644 index 0000000..b7f537d Binary files /dev/null and b/.codex-tasks/template-audit-execution/raw/visual-matrix-final/empty-03-linjing-editorial-doors.png differ diff --git a/PROJECT_STATUS.md b/PROJECT_STATUS.md index 872d9a9..b9f9df5 100644 --- a/PROJECT_STATUS.md +++ b/PROJECT_STATUS.md @@ -1,6 +1,6 @@ # Project Status -最后更新:2026-10-18 +最后更新:2026-10-20 ## 当前阶段 @@ -14,7 +14,7 @@ - 三套已交付模板: - `acheng-campus-food@1.0.3` - `atelier-solopreneur@1.3.2` - - `linjing-editorial@1.0.6` + - `linjing-editorial@1.0.7` - Taro Runtime、Admin 组件预览、真实 manifest 驱动编辑、草稿/发布隔离。 - 依赖 override 的运行时兼容性通过 `miniprogram-ci` / Jimp / image-size / uuid smoke test 守卫。 - 小程序构建、上传任务状态机、attempt lease 和失败记录。 @@ -67,7 +67,7 @@ unresolvedIssues=0 - 当前三个新版本已通过模板导入服务导入并发布: - `acheng-campus-food@1.0.3` - `atelier-solopreneur@1.3.2` - - `linjing-editorial@1.0.6` + - `linjing-editorial@1.0.7` - 既有品牌安装仍锁定各自原版本,需通过 Admin 的显式升级流程升级,不在本任务中静默变更。 ## 未决事项 diff --git a/apps/admin/design.md b/apps/admin/design.md index d27f912..8fe0d9f 100644 --- a/apps/admin/design.md +++ b/apps/admin/design.md @@ -270,19 +270,21 @@ 以下为各页面的视觉结构约定,业务逻辑不变。 -| 页面 | 结构要点 | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | -| 登录 | 居中 400px 卡片,标识 + 说明 + 表单 + 通栏主按钮;错误态展示在字段下方 | -| 首次改密 | 同登录卡片形态,说明文案 + 三个密码字段 + 「保存新密码」 | -| 品牌概览 | 品牌卡 + 三张指标卡(等宽一行)+ 两栏(发布准备度 / 品牌内容检查) | -| 配置与发布 | 三 Tab(内容发布 / 小程序发布 / 小程序配置);内容发布含「选择表达方式」(行业模板 + 视觉模板 + 版本升级/回滚)+ 发布状态卡 + 草稿卡 + 历史版本表 | -| 小程序页面 | 左右两栏:左 380px 编辑面板,右预览画布;预览内选中区域虚线高亮 + 区域名气泡 | -| 信任内容 | 列表行(类型图标或配图 + 标题 + 发布状态标签 + 类型/展示位置说明 + 两行摘要 + 行内操作),按模板类型顺序排列,不用表格 | -| 业务提供项 | 表格(名称 / 价格 / 状态开关 / 排序 / 操作)+ 新增弹窗 | -| 咨询记录 | 顶部三指标 + 左 380px 列表 + 右详情的主从布局 | -| 咨询表单与字段 | 咨询表单表(名称 / 版本 / 字段数 / 状态 / 操作)+ 新增与编辑弹窗(含选项编辑);高级自定义字段表 + 新增弹窗 | -| 能力插件 | 插件卡片列表(图标 + 名称 + 说明 + 开关),停用态降低对比度 | -| 团队成员 | 表格(成员 / 角色 / 状态 / 最近登录 / 操作)+ 邀请弹窗 | +| 页面 | 结构要点 | +| -------------- | ---------------------------------------------------------------------------------------------------------------------- | +| 登录 | 居中 400px 卡片,标识 + 说明 + 表单 + 通栏主按钮;错误态展示在字段下方 | +| 首次改密 | 同登录卡片形态,说明文案 + 三个密码字段 + 「保存新密码」 | +| 品牌概览 | 品牌卡 + 三张指标卡(等宽一行)+ 两栏(发布准备度 / 品牌内容检查) | +| 内容与发布 | 内容发布 / 小程序发布 / 小程序配置三个分区;内容发布含发布状态卡、草稿卡和历史版本表,不承载业务类型或页面方案选择 | +| 页面方案 | 当前业务类型与页面方案 + 升级预览 + 版本选择 + 配置恢复 + 高级示例内容导入 | +| 品牌管理 | 品牌列表与创建入口;创建品牌先选不可变的业务类型,再选兼容页面方案,创建时不导入示例内容 | +| 小程序页面 | 左右两栏:左 380px 编辑面板,右预览画布;预览内选中区域虚线高亮 + 区域名气泡 | +| 信任内容 | 列表行(类型图标或配图 + 标题 + 发布状态标签 + 类型/展示位置说明 + 两行摘要 + 行内操作),按模板类型顺序排列,不用表格 | +| 业务提供项 | 表格(名称 / 价格 / 状态开关 / 排序 / 操作)+ 新增弹窗 | +| 咨询记录 | 顶部三指标 + 左 380px 列表 + 右详情的主从布局 | +| 咨询表单与字段 | 咨询表单表(名称 / 版本 / 字段数 / 状态 / 操作)+ 新增与编辑弹窗(含选项编辑);高级自定义字段表 + 新增弹窗 | +| 能力插件 | 插件卡片列表(图标 + 名称 + 说明 + 开关),停用态降低对比度 | +| 团队成员 | 表格(成员 / 角色 / 状态 / 最近登录 / 操作)+ 邀请弹窗 | 两栏页面在小屏下折叠为单列,编辑/预览改为上下排列。 diff --git a/apps/admin/src/app/Dashboard.tsx b/apps/admin/src/app/Dashboard.tsx index 48ca7bb..d6cde3e 100644 --- a/apps/admin/src/app/Dashboard.tsx +++ b/apps/admin/src/app/Dashboard.tsx @@ -4,9 +4,11 @@ import { BarsOutlined, CloudUploadOutlined, FormOutlined, + LayoutOutlined, MessageOutlined, MobileOutlined, SafetyCertificateOutlined, + ShopOutlined, TeamOutlined, ThunderboltOutlined, } from "@ant-design/icons"; @@ -16,10 +18,13 @@ import { BrandMark } from "../components/BrandMark.js"; import { StatusTag } from "../components/StatusTag.js"; import { FeatureBrandPage, + FeatureBrandsPage, FeatureCapabilitiesPage, + FeatureCreateBrandPage, FeatureInquiriesPage, FeatureMembersPage, FeatureOverviewPage, + FeaturePageSchemePage, FeaturePublicationPage, FeatureTemplateManagementPage, FeatureServicesPage, @@ -34,6 +39,7 @@ import { AdminSelect } from "../components/AdminSelect.js"; import { AdminLayout } from "../components/AdminLayout.js"; import { Route, Routes } from "react-router-dom"; import { AdminOverviewRedirect } from "./AdminRouter.js"; +import { createBrandRouteElement } from "./route-access.js"; import { Suspense } from "react"; export function Dashboard({ @@ -70,7 +76,7 @@ export function Dashboard({ label: "日常经营", children: [ { key: "overview", label: "当前品牌概览", icon: }, - { key: "publication", label: "配置与发布", icon: }, + { key: "publication", label: "内容与发布", icon: }, { key: "brand", label: "小程序页面", icon: }, { key: "trust", label: "信任内容", icon: }, { key: "services", label: "业务提供项", icon: }, @@ -83,8 +89,10 @@ export function Dashboard({ : [ { type: "group" as const, - label: "系统管理", + label: "品牌设置", children: [ + { key: "brands", label: "品牌管理", icon: }, + { key: "page-scheme", label: "页面方案", icon: }, { key: "capabilities", label: "能力插件", icon: }, { key: "members", label: "团队成员", icon: }, ...(platformTemplateRole === "template_admin" @@ -141,10 +149,7 @@ export function Dashboard({ } /> } /> - } - /> + } /> } /> } /> } /> @@ -152,6 +157,15 @@ export function Dashboard({ } /> {role === "editor" ? null : ( <> + } + /> + )} + /> + } /> } /> } /> {platformTemplateRole === "template_admin" ? ( diff --git a/apps/admin/src/app/route-access.ts b/apps/admin/src/app/route-access.ts new file mode 100644 index 0000000..af366dc --- /dev/null +++ b/apps/admin/src/app/route-access.ts @@ -0,0 +1,14 @@ +import { createElement, type ReactNode } from "react"; +import { Navigate } from "react-router-dom"; + +export const createBrandFallbackPath = "/admin/brands"; + +export function canCreateBrand(role: string) { + return role === "owner"; +} + +export function createBrandRouteElement(role: string, content: ReactNode) { + return canCreateBrand(role) + ? content + : createElement(Navigate, { to: createBrandFallbackPath, replace: true }); +} diff --git a/apps/admin/src/app/routes.tsx b/apps/admin/src/app/routes.tsx index e14c50f..71c5e20 100644 --- a/apps/admin/src/app/routes.tsx +++ b/apps/admin/src/app/routes.tsx @@ -48,3 +48,18 @@ export const FeatureTemplateManagementPage = React.lazy(() => default: module.TemplateManagementPage, })), ); +export const FeatureBrandsPage = React.lazy(() => + import("../features/brands/BrandsPage.js").then((module) => ({ + default: module.BrandsPage, + })), +); +export const FeatureCreateBrandPage = React.lazy(() => + import("../features/brands/CreateBrandPage.js").then((module) => ({ + default: module.CreateBrandPage, + })), +); +export const FeaturePageSchemePage = React.lazy(() => + import("../features/page-scheme/PageSchemePage.js").then((module) => ({ + default: module.PageSchemePage, + })), +); diff --git a/apps/admin/src/features/brand/BrandPage.tsx b/apps/admin/src/features/brand/BrandPage.tsx index 49e729c..0b119bb 100644 --- a/apps/admin/src/features/brand/BrandPage.tsx +++ b/apps/admin/src/features/brand/BrandPage.tsx @@ -1,4 +1,4 @@ -import { Alert, Button, Col, Form, Input, Row, Select, Segmented, message } from "antd"; +import { Alert, Button, Col, Form, Input, Row, Segmented, message } from "antd"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { Link, useLocation } from "react-router-dom"; @@ -36,10 +36,6 @@ export function BrandPage() { queryFn: () => client.getPublicTemplate(brand.data!.templateKey), enabled: Boolean(brand.data?.templateKey), }); - const templateCatalog = useQuery({ - queryKey: ["template-catalog"], - queryFn: () => client.listPublicTemplates(), - }); const save = useMutation({ mutationFn: (values: Partial) => client.updateAdminBrand(values), onSuccess: () => { @@ -60,7 +56,12 @@ export function BrandPage() { ? `先让访客理解你是谁、服务谁,以及为什么值得信任。${template.data.description}` : "先让访客理解你是谁、服务谁,以及为什么值得信任。" } - extra={} + extra={ + + } />

- 模板与品牌视觉 + 品牌视觉

- 模板负责业务表达,品牌信息仍由你统一维护。 + 头像和封面会用于品牌身份展示;页面结构和资源位由页面方案统一管理。

- - + + + + + + + + + + + + + + + {(options.data?.businesses ?? []).map((business: BrandCreationOptionBusiness) => ( + + + {business.name} + {business.description} + + + ))} + + + + {businessType ? ( + schemes.length ? null : ( + + ) + ) : ( + + )} + + + + {schemes.length ? ( + + + + {schemes.map((scheme) => ( + + + {scheme.name} + + + {scheme.description} + + ))} + + + + ) : ( + + )} + + + + + + + + + + + + ); +} diff --git a/apps/admin/src/features/capabilities/CapabilitiesPage.tsx b/apps/admin/src/features/capabilities/CapabilitiesPage.tsx index 412dc56..89423bb 100644 --- a/apps/admin/src/features/capabilities/CapabilitiesPage.tsx +++ b/apps/admin/src/features/capabilities/CapabilitiesPage.tsx @@ -15,7 +15,7 @@ export function CapabilitiesPage() { void query.refetch()}> {query.data?.length ? ( @@ -29,9 +29,9 @@ export function CapabilitiesPage() { } - title="当前模板没有可配置能力" - description="能力的开关由品牌当前使用的行业模板决定;更换行业模板不在本版本范围内。" - action={} + title="当前页面方案没有可配置能力" + description="能力由品牌当前使用的业务类型和页面方案决定。" + action={} /> )} diff --git a/apps/admin/src/features/capabilities/components/CapabilityCard.tsx b/apps/admin/src/features/capabilities/components/CapabilityCard.tsx index 83f75d1..97c7f35 100644 --- a/apps/admin/src/features/capabilities/components/CapabilityCard.tsx +++ b/apps/admin/src/features/capabilities/components/CapabilityCard.tsx @@ -8,12 +8,12 @@ import { CapabilityStatusControl, CapabilityStatusTag } from "./CapabilityStatus const sourceLabels = { brand: "品牌覆盖", - template: "模板默认", + template: "方案默认", } as const; const disablePolicyLabels = { allowed: "该能力允许停用,保存后进入草稿。", - disabled: "该能力为模板必需项,保存后进入草稿。", + disabled: "该能力为页面方案必需项,保存后进入草稿。", } as const; const updatedTimeFormatter = new Intl.DateTimeFormat("zh-CN", { @@ -143,7 +143,7 @@ export function CapabilityCard({ capability }: { capability: AdminCapability }) ) : null} {capability.source === "template" - ? "当前使用模板默认设置;修改后保存会创建品牌覆盖。" + ? "当前使用页面方案默认设置;修改后保存会创建品牌覆盖。" : "当前已创建品牌覆盖;修改后保存会更新草稿。"} {capability.updatedAt ? ` 最近更新:${updatedTimeFormatter.format(new Date(capability.updatedAt))}` diff --git a/apps/admin/src/features/inquiries/InquiriesPage.tsx b/apps/admin/src/features/inquiries/InquiriesPage.tsx index 3dc4bd6..246aec0 100644 --- a/apps/admin/src/features/inquiries/InquiriesPage.tsx +++ b/apps/admin/src/features/inquiries/InquiriesPage.tsx @@ -213,7 +213,7 @@ export function InquiriesPage() { void submissions.refetch()} loading={submissions.isFetching}> 刷新提交记录 @@ -248,7 +248,7 @@ export function InquiriesPage() { ), }} diff --git a/apps/admin/src/features/overview/OverviewPage.tsx b/apps/admin/src/features/overview/OverviewPage.tsx index a6b8576..ffd0470 100644 --- a/apps/admin/src/features/overview/OverviewPage.tsx +++ b/apps/admin/src/features/overview/OverviewPage.tsx @@ -90,7 +90,7 @@ export function OverviewPage() {

{brand?.tagline || "还没有设置一句话定位"}

diff --git a/apps/admin/src/features/page-scheme/PageSchemePage.tsx b/apps/admin/src/features/page-scheme/PageSchemePage.tsx new file mode 100644 index 0000000..151091f --- /dev/null +++ b/apps/admin/src/features/page-scheme/PageSchemePage.tsx @@ -0,0 +1,375 @@ +import { useEffect, useState } from "react"; +import { Alert, Button, Card, Collapse, Descriptions, Empty, List, Modal, Space, Tag } from "antd"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; +import { createApiClient } from "../../lib/api.js"; +import { adminMessage as message } from "../../components/AdminMessage.js"; +import { AdminPageHeader } from "../../components/AdminPageHeader.js"; +import { AdminSection } from "../../components/AdminSection.js"; +import { MutationError, QueryState } from "../../components/QueryState.js"; +import { StatusTag } from "../../components/StatusTag.js"; + +const client = createApiClient(); + +export function PageSchemePage() { + const queryClient = useQueryClient(); + const [selectedVersionId, setSelectedVersionId] = useState(); + const [samplePreview, setSamplePreview] = useState + > | null>(null); + const workspace = useQuery({ + queryKey: ["page-scheme-workspace"], + queryFn: () => client.getAdminWorkspace(), + }); + const options = useQuery({ + queryKey: ["admin-page-scheme-options"], + queryFn: () => client.getAdminPageSchemeOptions(), + }); + const upgradePreview = useQuery({ + queryKey: ["page-scheme-upgrade-preview"], + queryFn: () => client.getAdminTemplateUpgradePreview(), + }); + const installation = workspace.data?.installations[0]; + const currentVersionId = installation?.templatePackageVersionId; + const currentScheme = options.data?.pageSchemes.find( + (scheme) => scheme.templatePackageVersionId === currentVersionId, + ); + const business = options.data?.business; + const compatibleSchemes = options.data?.pageSchemes ?? []; + + useEffect(() => { + if (currentVersionId) setSelectedVersionId(currentVersionId); + }, [currentVersionId]); + + const refresh = () => { + for (const queryKey of [ + "page-scheme-workspace", + "page-scheme-upgrade-preview", + "admin-workspace", + "admin-preview-workspace", + "admin-overview-workspace", + "publication-workspace", + "publication-readiness", + ]) { + void queryClient.invalidateQueries({ queryKey: [queryKey] }); + } + }; + + const selectVersion = useMutation({ + mutationFn: (templatePackageVersionId: string) => + client.selectAdminTemplateVersion({ + templatePackageVersionId, + expectedCurrentPackageVersionId: currentVersionId ?? null, + confirm: true, + }), + onSuccess: () => { + message.success("页面方案版本已切换"); + refresh(); + }, + }); + const upgrade = useMutation({ + mutationFn: async () => { + const preview = upgradePreview.data; + if ( + !preview?.canUpgrade || + !preview.targetPackageVersionId || + !preview.targetContentChecksum + ) { + throw new Error("当前没有可升级的页面方案版本,请刷新后重试"); + } + return client.upgradeAdminTemplate({ + templatePackageVersionId: preview.targetPackageVersionId, + expectedContentChecksum: preview.targetContentChecksum, + expectedCurrentVersion: preview.currentVersion, + expectedCurrentPackageVersionId: preview.currentPackageVersionId, + confirm: true, + preservedBindings: preview.conflicts.map(({ key, binding }) => ({ + key, + binding, + action: "preserve", + })), + }); + }, + onSuccess: () => { + message.success("页面方案已升级,现有内容已全部保留"); + refresh(); + }, + }); + const rollback = useMutation({ + mutationFn: () => { + const preview = upgradePreview.data; + if (!preview?.canRollback) throw new Error("当前没有可恢复的上一版配置基线"); + return client.rollbackAdminTemplate({ + expectedCurrentVersion: preview.currentVersion, + confirm: true, + }); + }, + onSuccess: () => { + message.success("已恢复上一版页面方案配置基线"); + refresh(); + }, + }); + const previewSample = useMutation({ + mutationFn: () => + client.previewAdminSampleContent({ + ...(currentVersionId ? { templatePackageVersionId: currentVersionId } : {}), + strategy: "missing_only", + }), + onSuccess: (data) => setSamplePreview(data), + }); + const importSample = useMutation({ + mutationFn: () => + client.importAdminSampleContent({ + ...(currentVersionId ? { templatePackageVersionId: currentVersionId } : {}), + strategy: "missing_only", + confirm: true, + }), + onSuccess: () => { + message.success("示例内容已按缺失项导入,现有内容未被覆盖"); + setSamplePreview(null); + refresh(); + }, + }); + + const confirmSelect = (templatePackageVersionId: string) => { + const target = compatibleSchemes.find( + (scheme) => scheme.templatePackageVersionId === templatePackageVersionId, + ); + Modal.confirm({ + title: "切换页面方案版本", + content: target + ? `将当前品牌切换到「${target.name}」版本 ${target.version}。现有品牌内容会保留。` + : "将切换当前品牌使用的页面方案版本。现有品牌内容会保留。", + okText: "确认切换", + cancelText: "取消", + onOk: () => selectVersion.mutateAsync(templatePackageVersionId), + }); + }; + const confirmUpgrade = () => { + const preview = upgradePreview.data; + Modal.confirm({ + title: "升级页面方案", + content: + preview && preview.conflicts.length + ? `将升级到版本 ${preview.latestVersion},并全部保留 ${preview.conflicts.length} 项现有内容。` + : `将升级到版本 ${preview?.latestVersion ?? "最新版"},现有品牌内容会保留。`, + okText: "确认升级", + cancelText: "取消", + onOk: () => upgrade.mutateAsync(), + }); + }; + const confirmRollback = () => { + Modal.confirm({ + title: "恢复上一版配置基线", + content: "此操作只恢复上一版页面方案配置,不会删除品牌内容、业务提供项或咨询记录。", + okText: "确认恢复", + cancelText: "取消", + onOk: () => rollback.mutateAsync(), + }); + }; + + return ( + { + void workspace.refetch(); + void options.refetch(); + void upgradePreview.refetch(); + }} + > + +
+ + + {business?.name ?? "未识别"} + + {currentScheme?.name ?? workspace.data?.templateContent?.displayName ?? "尚未安装"} + + + + + + {business?.description ? ( +

{business.description}

+ ) : null} +
+ + + + {upgradePreview.data?.canUpgrade ? ( + +
+ 可升级到版本 {upgradePreview.data.latestVersion} + 建议先预览 +
+ + + {upgradePreview.data.changes.pages.added.length} + + + {upgradePreview.data.changes.pages.changed.length} + + + {upgradePreview.data.changes.templateBindings.added.length} + + + {upgradePreview.data.conflicts.length} + + + {upgradePreview.data.conflicts.length ? ( + + ) : ( + + )} + +
+ ) : ( + + )} + +
+
+ + + { + const isCurrent = scheme.templatePackageVersionId === currentVersionId; + return ( + { + setSelectedVersionId(scheme.templatePackageVersionId); + confirmSelect(scheme.templatePackageVersionId); + }} + > + {isCurrent ? "当前版本" : "切换到此版本"} + , + ]} + > + + {scheme.name} + + {scheme.isLatestForPackage ? "最新版" : `版本 ${scheme.version}`} + + + } + description={`${scheme.description} · 版本 ${scheme.version}`} + /> + + ); + }} + /> + + + + + + + + + + + + + + + + {samplePreview ? ( + + + {samplePreview.counts.brandConfig} + + + {samplePreview.counts.offerings} + + + {samplePreview.counts.trustContent} + + + {samplePreview.counts.fields} + + + {samplePreview.counts.inquiryForms} + + + {samplePreview.alreadyImported ? "是" : "否"} + + + ) : null} + + ), + }, + ]} + /> +
+
+ ); +} diff --git a/apps/admin/src/features/publication/PublicationPage.tsx b/apps/admin/src/features/publication/PublicationPage.tsx index 8f30d12..1095e86 100644 --- a/apps/admin/src/features/publication/PublicationPage.tsx +++ b/apps/admin/src/features/publication/PublicationPage.tsx @@ -1,26 +1,11 @@ import { useState } from "react"; import { useNavigate } from "react-router-dom"; import { useQueryClient } from "@tanstack/react-query"; -import { - Alert, - Button, - Checkbox, - Divider, - Input, - Popconfirm, - Modal, - Form, - Select, - Space, - Spin, - Tabs, - Typography, -} from "antd"; -import type { BrandTemplateKey } from "@personal-brand/api-client"; +import { Alert, Button, Divider, Form, Input, Modal, Space, Tabs, Typography } from "antd"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { AdminSection } from "../../components/AdminSection.js"; import { EmptyState } from "../../components/EmptyState.js"; -import { ErrorNote, MutationError, QueryState } from "../../components/QueryState.js"; +import { MutationError, QueryState } from "../../components/QueryState.js"; import { StatusTag, statusLabel } from "../../components/StatusTag.js"; import { MiniAppReleaseCard } from "./MiniAppReleaseCard.js"; import { MiniAppSettingsTab, type MiniAppSettingsValues } from "./MiniAppSettingsTab.js"; @@ -30,34 +15,28 @@ import { usePublicationMutations } from "./use-publication-mutations.js"; const destinations: Record = { brand: "/admin/brand", positioning: "/admin/brand", - template: "/admin/publication", - visual: "/admin/publication", + template: "/admin/page-scheme", + visual: "/admin/page-scheme", offerings: "/admin/services", forms: "/admin/workspace", trust: "/admin/trust", }; -export function PublicationPage({ canManageTemplate }: { canManageTemplate: boolean }) { +export function PublicationPage() { const navigate = useNavigate(); const queryClient = useQueryClient(); - const [industryTarget, setIndustryTarget] = useState(null); const [confirmAction, setConfirmAction] = useState<"publish" | "revoke" | null>(null); const [rollbackVersion, setRollbackVersion] = useState(null); - const [preservedBindings, setPreservedBindings] = useState>({}); const [note, setNote] = useState(""); const [activeTab, setActiveTab] = useState("content"); const [miniAppSettingsForm] = Form.useForm(); const queries = usePublicationQueries(miniAppSettingsForm); const { - brand, workspace, - catalog, - sample, readiness, releases, miniAppReleases, miniAppSettings, - templatePreview, loading, error, retry, @@ -66,11 +45,10 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool for (const key of [ "publication-brand", "publication-workspace", - "publication-sample", "publication-readiness", - "publication-template-preview", "publication-releases", "publication-miniapp-releases", + "publication-miniapp-settings", "admin-shell-brand", "admin-workspace", "public-runtime-workspace", @@ -80,18 +58,11 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool }; const mutations = usePublicationMutations({ refresh, - currentTemplatePackageVersionId: workspace.data?.installations[0]?.templatePackageVersionId, - onInstallClose: () => setIndustryTarget(null), onPublishClose: () => setConfirmAction(null), onNoteClear: () => setNote(""), onRollbackClose: () => setRollbackVersion(null), }); const { - install, - upgradeTemplate, - rollbackTemplate, - selectVisual, - importSample, publish, revoke, rollback, @@ -100,18 +71,6 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool uploadMiniAppRelease, updateMiniAppStatus, } = mutations; - const industryKey = - workspace.data?.installations[0]?.templateKey ?? - workspace.data?.brand?.templateKey ?? - brand.data?.templateKey ?? - null; - const selectablePackageVersions = (queries.packages.data?.items ?? []).filter( - (item) => - item.status === "published" && - typeof industryKey === "string" && - item.manifestSummary?.supportedIndustryTemplates.includes(industryKey), - ); - const visualKey = workspace.data?.installations[0]?.visualTemplateKey ?? null; const currentRelease = releases.data?.find((item) => item.status === "published"); const publishedHistory = (releases.data ?? []).filter( (item) => item.status === "published" || item.status === "superseded", @@ -123,12 +82,12 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool isEnabled: boolean; }>; - const contentTab = null; return ( navigate("/admin/page-scheme")}>管理页面方案} /> + + {draftOfferings.length || draftForms.length ? ( +

+ 当前草稿包含 {draftOfferings.length} 个启用中的业务提供项和{" "} + {draftForms.length} 个咨询表单。 +

+ ) : null} +
    + {(readiness.data?.checks ?? []).map((check) => ( +
  • +
    +
    + + {check.label} + {!check.passed && check.help ? ( + {check.help} + ) : null} +
    +
    + {!check.passed ? ( + + ) : null} +
  • + ))} +
+ + + {currentRelease && ( + + )} + + + +

发布记录

+ {releases.data?.length ? ( +
    + {releases.data.map((item) => ( +
  • +
    +
    + v{item.version} + + + {new Date(item.createdAt).toLocaleString("zh-CN")} + + {item.note ? ( + {item.note} + ) : null} +
    +
    + {item.status === "superseded" && publishedHistory.length > 1 ? ( + + ) : null} +
  • + ))} +
+ ) : ( + + )} + +
+ + ), + }, + { + key: "miniapp", + label: "小程序发布", + children: ( +
+ + + {miniAppSettings.data?.hasStoredCredentials ? ( + + ) : ( + + )} + + } + > + {miniAppReleases.data?.length ? ( +
+ {miniAppReleases.data.map((task) => ( + uploadMiniAppRelease.mutate(task.id)} + onStatusChange={(status) => + updateMiniAppStatus.mutate({ id: task.id, status }) + } + /> + ))} +
+ ) : ( + + )} +
+
+ ), }, - { key: "miniapp", label: "小程序发布", children: null }, { key: "settings", label: "小程序配置", - children: - activeTab === "settings" ? ( - saveMiniAppSettings.mutate(values)} - /> - ) : null, + children: ( + saveMiniAppSettings.mutate(values)} + /> + ), }, ]} /> - {activeTab === "content" && ( -
- - - ({ - value: item.id, - label: `${item.displayName} · ${item.version}`, - }))} - onChange={(versionId) => selectVisual.mutate(versionId)} - /> - - {industryKey ? ( -
- - - - {templatePreview.data?.canUpgrade ? ( - { - const preview = templatePreview.data; - if (!preview?.targetPackageVersionId || !preview.targetContentChecksum) - return; - if ( - !preview.conflicts.every( - (item) => preservedBindings[`${item.key}:${item.binding}`], - ) - ) - return; - upgradeTemplate.mutate({ - templatePackageVersionId: preview.targetPackageVersionId, - expectedContentChecksum: preview.targetContentChecksum, - expectedCurrentVersion: preview.currentVersion, - expectedCurrentPackageVersionId: preview.currentPackageVersionId, - confirm: true, - preservedBindings: preview.conflicts.map(({ key, binding }) => ({ - key, - binding, - action: "preserve" as const, - })), - }); - }} - > - - - ) : ( - - )} - {templatePreview.data?.canRollback ? ( - { - const currentVersion = templatePreview.data?.currentVersion; - if (!currentVersion) return; - rollbackTemplate.mutate({ - expectedCurrentVersion: currentVersion, - confirm: true, - }); - }} - > - - - ) : null} - -

- 行业模板随品牌身份固定。升级目标为当前视觉模板最新已发布包,并按包版本与 checksum - 锁定预览;新增字段会补入,改动冲突和已移除字段不会覆盖或删除。回滚仅恢复配置基线,不删除品牌字段、内容或历史发布。 -

- {templatePreview.data?.conflicts.length ? ( - - {templatePreview.data.conflicts.map((item) => { - const key = `${item.key}:${item.binding}`; - return ( - - setPreservedBindings((current) => ({ - ...current, - [key]: event.target.checked, - })) - } - > - 保留 {item.binding}({item.reason}) - - ); - })} - - } - /> - ) : null} - {templatePreview.data ? ( -
- 页面入口变更:新增 {templatePreview.data.changes.pages.added.length}、变更{" "} - {templatePreview.data.changes.pages.changed.length}、移除{" "} - {templatePreview.data.changes.pages.removed.length};资源槽位变更:新增{" "} - {templatePreview.data.changes.assets.slots.added.length}、变更{" "} - {templatePreview.data.changes.assets.slots.changed.length}、移除{" "} - {templatePreview.data.changes.assets.slots.removed.length}; - {templatePreview.data.changes.assets.files.available - ? `包内文件变更:新增 ${templatePreview.data.changes.assets.files.added?.length ?? 0}、变更 ${templatePreview.data.changes.assets.files.changed?.length ?? 0}、移除 ${templatePreview.data.changes.assets.files.removed?.length ?? 0}` - : templatePreview.data.changes.assets.files.reason} - 。模块与 renderer 由已部署的平台视觉模板管理,此次包升级不会替换 renderer。 -
- ) : null} - -
- ) : null} - - - - 示例内容 - {sample.isLoading && } - {sample.data && ( - - )} - - {sample.isError && } - - {sample.isError && ( -
- void sample.refetch()} /> -
- )} - {sample.data && !sample.data.alreadyImported && ( -

- 来源:{sample.data.source.packageKey}@{sample.data.source.version} - (checksum {(sample.data.source.contentChecksum ?? "").slice(0, 12)}) - 。将向草稿添加{" "} - {Object.entries(sample.data.counts) - .map(([key, count]) => `${key} ${count} 项`) - .join("、")} - ;同时补齐当前模板缺失的页面初始配置,保留已有配置和已启用表单。发布前请替换示例文案和图片。 -

- )} - -
- -
    -
  • -
    -
    - {brand.data?.name || "未命名品牌"} - - {brand.data?.tagline || "尚未填写品牌定位"} - -
    -
    -
  • -
  • -
    -
    - 已启用业务项 - - {draftOfferings.map((item) => item.name).join("、") || "无"} - -
    -
    -
  • -
  • -
    -
    - 已启用咨询表单 - - {draftForms - .filter((item) => item.isEnabled) - .map((item) => item.name) - .join("、") || "无"} - -
    -
    -
  • -
- - - - - -
- - - - - } - > -
    - {(readiness.data?.checks ?? []).map((check) => ( -
  • -
    -
    - - {check.label} - {!check.passed && check.help ? ( - {check.help} - ) : null} -
    -
    - {!check.passed ? ( - - ) : null} -
  • - ))} -
- - - {currentRelease && ( - - )} - - - -

发布记录

- {releases.data?.length ? ( -
    - {releases.data.map((item) => ( -
  • -
    -
    - v{item.version} - - - {new Date(item.createdAt).toLocaleString("zh-CN")} - - {item.note ? {item.note} : null} -
    -
    - {item.status === "superseded" && publishedHistory.length > 1 ? ( - - ) : null} -
  • - ))} -
- ) : ( - - )} - -
-
- )} - {activeTab === "miniapp" && ( -
- - - {miniAppSettings.data?.hasStoredCredentials ? ( - - ) : ( - - )} - - } - > - {miniAppReleases.data?.length ? ( -
- {miniAppReleases.data.map((task) => ( - uploadMiniAppRelease.mutate(task.id)} - onStatusChange={(status) => updateMiniAppStatus.mutate({ id: task.id, status })} - /> - ))} -
- ) : ( - - )} -
-
- )} 将 v{rollbackVersion} 重新发布为新版本;当前草稿不会被覆盖。 - setIndustryTarget(null)} - okButtonProps={{ disabled: !templatePreview.data?.targetPackageVersionId }} - onOk={() => - industryTarget && - templatePreview.data?.targetPackageVersionId && - install.mutate({ - key: industryTarget, - versionId: templatePreview.data.targetPackageVersionId, - }) - } - confirmLoading={install.isPending} - > - 模板会更新当前品牌的草稿结构,不会立即改变已发布的小程序。请安装后核对业务内容与视觉模板。 -
); } diff --git a/apps/admin/src/features/publication/use-publication-mutations.ts b/apps/admin/src/features/publication/use-publication-mutations.ts index b35318c..ecc895f 100644 --- a/apps/admin/src/features/publication/use-publication-mutations.ts +++ b/apps/admin/src/features/publication/use-publication-mutations.ts @@ -1,14 +1,11 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"; import { message } from "antd"; -import type { BrandTemplateKey } from "@personal-brand/api-client"; import { createApiClient } from "../../lib/api.js"; const client = createApiClient(); interface MutationOptions { refresh: () => void; - currentTemplatePackageVersionId: string | null | undefined; - onInstallClose: () => void; onPublishClose: () => void; onNoteClear: () => void; onRollbackClose: () => void; @@ -16,83 +13,11 @@ interface MutationOptions { export function usePublicationMutations({ refresh, - onInstallClose, onPublishClose, onNoteClear, onRollbackClose, - currentTemplatePackageVersionId, }: MutationOptions) { const queryClient = useQueryClient(); - const install = useMutation({ - mutationFn: ({ key, versionId }: { key: BrandTemplateKey; versionId: string }) => - client.installAdminTemplate(key, versionId), - onSuccess: () => { - onInstallClose(); - message.success("行业模板已安装"); - refresh(); - }, - }); - const upgradeTemplate = useMutation({ - mutationFn: (input: { - templatePackageVersionId: string; - expectedContentChecksum: string; - expectedCurrentVersion: string; - expectedCurrentPackageVersionId: string | null; - confirm: true; - preservedBindings: Array<{ key: string; binding: string; action: "preserve" }>; - }) => client.upgradeAdminTemplate(input), - onSuccess: () => { - message.success("行业模板已升级,现有内容未被覆盖"); - refresh(); - }, - }); - const rollbackTemplate = useMutation({ - mutationFn: (input: { expectedCurrentVersion: string; confirm: true }) => - client.rollbackAdminTemplate(input), - onSuccess: () => { - message.success("行业模板配置基线已回滚"); - refresh(); - }, - }); - const selectVisual = useMutation({ - mutationFn: (templatePackageVersionId: string) => - client.selectAdminTemplateVersion({ - templatePackageVersionId, - ...(currentTemplatePackageVersionId !== undefined - ? { expectedCurrentPackageVersionId: currentTemplatePackageVersionId } - : {}), - confirm: true, - }), - onSuccess: () => { - message.success("模板版本已切换"); - refresh(); - }, - }); - const importSample = useMutation< - Awaited>, - Error, - string | undefined - >({ - mutationFn: (templatePackageVersionId) => - client.importAdminSampleContent({ - ...(templatePackageVersionId ? { templatePackageVersionId } : {}), - strategy: "missing_only", - confirm: true, - }), - onSuccess: ({ counts, alreadyImported }) => { - if (alreadyImported) { - message.info("该模板包版本的示例内容已导入,未重复创建"); - refresh(); - return; - } - message.success( - counts.inquiryForms - ? "示例内容和客户咨询表单已导入草稿" - : "示例内容已导入草稿,现有客户咨询表单已保留", - ); - refresh(); - }, - }); const publish = useMutation({ mutationFn: (note: string) => client.publishAdminRelease(note || undefined), onSuccess: () => { @@ -163,11 +88,6 @@ export function usePublicationMutations({ }); return { - install, - upgradeTemplate, - rollbackTemplate, - selectVisual, - importSample, publish, revoke, rollback, diff --git a/apps/admin/src/features/publication/use-publication-queries.ts b/apps/admin/src/features/publication/use-publication-queries.ts index 0b5846c..c8dd5da 100644 --- a/apps/admin/src/features/publication/use-publication-queries.ts +++ b/apps/admin/src/features/publication/use-publication-queries.ts @@ -20,25 +20,6 @@ export function usePublicationQueries( queryKey: ["publication-workspace"], queryFn: () => client.getAdminWorkspace(), }); - const catalog = useQuery>>({ - queryKey: ["publication-catalog"], - queryFn: () => client.listPublicTemplates(), - }); - const packages = useQuery>>({ - queryKey: ["publication-template-packages"], - queryFn: () => client.listAdminTemplatePackages({ page: 1, pageSize: 100 }), - }); - const sample = useQuery>>({ - queryKey: ["publication-sample", workspace.data?.installations[0]?.templatePackageVersionId], - queryFn: () => - client.previewAdminSampleContent({ - ...(workspace.data?.installations[0]?.templatePackageVersionId - ? { templatePackageVersionId: workspace.data.installations[0].templatePackageVersionId } - : {}), - strategy: "missing_only", - }), - enabled: Boolean(workspace.data), - }); const readiness = useQuery>>({ queryKey: ["publication-readiness"], queryFn: () => client.getAdminReleaseReadiness(), @@ -55,12 +36,6 @@ export function usePublicationQueries( queryKey: ["publication-miniapp-settings"], queryFn: () => client.getAdminMiniAppSettings(), }); - const templatePreview = useQuery< - Awaited> - >({ - queryKey: ["publication-template-preview"], - queryFn: () => client.getAdminTemplateUpgradePreview(), - }); useEffect(() => { if (!miniAppSettings.data) return; @@ -82,31 +57,15 @@ export function usePublicationQueries( return () => clearInterval(timer); }, [miniAppReleases]); - const loading = [ - brand, - workspace, - catalog, - packages, - readiness, - releases, - miniAppReleases, - miniAppSettings, - ].some((query) => query.isLoading); - const error = [ - brand, - workspace, - catalog, - packages, - readiness, - releases, - miniAppReleases, - miniAppSettings, - ].find((query) => query.isError)?.error; + const loading = [brand, workspace, readiness, releases, miniAppReleases, miniAppSettings].some( + (query) => query.isLoading, + ); + const error = [brand, workspace, readiness, releases, miniAppReleases, miniAppSettings].find( + (query) => query.isError, + )?.error; const retry = () => { void brand.refetch(); void workspace.refetch(); - void catalog.refetch(); - void packages.refetch(); void readiness.refetch(); void releases.refetch(); void miniAppReleases.refetch(); @@ -116,14 +75,10 @@ export function usePublicationQueries( return { brand, workspace, - catalog, - packages, - sample, readiness, releases, miniAppReleases, miniAppSettings, - templatePreview, loading, error, retry, diff --git a/apps/admin/src/features/services/use-offering-editor.ts b/apps/admin/src/features/services/use-offering-editor.ts index 24cbf62..fd2bd40 100644 --- a/apps/admin/src/features/services/use-offering-editor.ts +++ b/apps/admin/src/features/services/use-offering-editor.ts @@ -20,7 +20,7 @@ export function useOfferingEditor(templateFields: TemplateAdminField[]) { const templateFieldSection = useMemo( () => ({ key: "offering", - title: "模板内容", + title: "页面方案内容", description: "", page: "detail", target: "offering", diff --git a/apps/admin/src/features/trust-content/TrustContentPage.tsx b/apps/admin/src/features/trust-content/TrustContentPage.tsx index e223439..324c1cc 100644 --- a/apps/admin/src/features/trust-content/TrustContentPage.tsx +++ b/apps/admin/src/features/trust-content/TrustContentPage.tsx @@ -66,7 +66,7 @@ export function TrustContentPage() { } /> span:last-child { + display: block; + width: 100%; +} + +.admin-choice-card .ant-radio-button { + display: none; +} + +.admin-choice-card span { + color: var(--admin-text-secondary); +} + +.admin-choice-card strong { + color: var(--admin-text); +} + .admin-content { flex: 1; padding: 24px; diff --git a/apps/admin/test/admin-routing.test.mjs b/apps/admin/test/admin-routing.test.mjs index 2fe2ac5..18a28e1 100644 --- a/apps/admin/test/admin-routing.test.mjs +++ b/apps/admin/test/admin-routing.test.mjs @@ -4,12 +4,20 @@ import { createElement } from "react"; import { renderToString } from "react-dom/server"; import { MemoryRouter, Route, Routes, resolvePath } from "react-router-dom"; import { AdminOverviewRedirect, AdminRouter } from "../src/app/AdminRouter.ts"; +import { + canCreateBrand, + createBrandFallbackPath, + createBrandRouteElement, +} from "../src/app/route-access.ts"; test("后台父路由正确匹配所有菜单及深层链接", () => { const pages = [ "overview", "publication", "brand", + "brands", + "brands/new", + "page-scheme", "trust", "services", "inquiries", @@ -51,3 +59,17 @@ test("默认与无效地址的概览重定向为绝对地址且替换历史记 assert.equal(resolvePath(redirect.props.to, pathname).pathname, "/admin/overview"); } }); + +test("只有品牌负责人可以进入创建品牌路由", () => { + assert.equal(canCreateBrand("owner"), true); + for (const role of ["admin", "editor", "platform-admin"]) { + assert.equal(canCreateBrand(role), false); + } + + const content = createElement("h1", null, "create-brand"); + assert.equal(createBrandRouteElement("owner", content), content); + + const denied = createBrandRouteElement("admin", content); + assert.equal(denied.props.to, createBrandFallbackPath); + assert.equal(denied.props.replace, true); +}); diff --git a/apps/api/prisma/assets/personal-avatar.jpg b/apps/api/prisma/assets/founder-portrait.jpg similarity index 100% rename from apps/api/prisma/assets/personal-avatar.jpg rename to apps/api/prisma/assets/founder-portrait.jpg diff --git a/apps/api/prisma/migrations/20261019100000_remove_brand_profile_defaults/migration.sql b/apps/api/prisma/migrations/20261019100000_remove_brand_profile_defaults/migration.sql new file mode 100644 index 0000000..1c069c2 --- /dev/null +++ b/apps/api/prisma/migrations/20261019100000_remove_brand_profile_defaults/migration.sql @@ -0,0 +1,2 @@ +ALTER TABLE "BrandProfile" ALTER COLUMN "slug" DROP DEFAULT; +ALTER TABLE "BrandProfile" ALTER COLUMN "templateKey" DROP DEFAULT; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 5539bf2..84e1d3a 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -35,9 +35,9 @@ enum FulfillmentType { model BrandProfile { id String @id @default(uuid()) - slug String @unique @default("default-brand") + slug String @unique name String - templateKey String @default("food") + templateKey String tagline String? description String? avatarUrl String? diff --git a/apps/api/prisma/seed.ts b/apps/api/prisma/seed.ts index eccba8e..36eccb7 100644 --- a/apps/api/prisma/seed.ts +++ b/apps/api/prisma/seed.ts @@ -1,9 +1,20 @@ +import { existsSync } from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; import { PrismaClient, type Prisma } from "@prisma/client"; import type { TemplatePackageManifest } from "@personal-brand/config"; import bcrypt from "bcryptjs"; import { buildBrandReleaseSnapshot } from "../src/brand-release.service.js"; +import { latestTemplateVersion } from "../src/template-version-order.js"; const prisma = new PrismaClient(); +const seedAssetsDirectory = path.join(path.dirname(fileURLToPath(import.meta.url)), "assets"); + +function seedMediaExists(url: unknown): boolean { + if (typeof url !== "string" || !url) return false; + if (!url.startsWith("/media/seed/")) return true; + return existsSync(path.join(seedAssetsDirectory, path.basename(url))); +} const runtimeImages = { doors: [ @@ -48,7 +59,7 @@ interface RuntimeSeedTemplate { const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTemplate> = { personal: { templateKey: "personal", - visualTemplateKey: "linjing-editorial", + visualTemplateKey: "atelier-solopreneur", brandConfig: { templateData: { designPhilosophy: "先厘清问题,再设计表达" }, title: "品牌策略顾问", @@ -299,7 +310,7 @@ const runtimeSeedTemplates: Record<"personal" | "food" | "doors", RuntimeSeedTem phone: "186-0218-9908", wechat: "LIN-ATELIER-2024", studioAddress: "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - avatarUrl: "/media/seed/personal-avatar.jpg", + avatarUrl: "/media/seed/founder-portrait.jpg", profilePresentation: { coverage: [ { @@ -718,23 +729,42 @@ async function ensureRuntimeContent(brandId: string, template: RuntimeSeedTempla data: { isEnabled: false }, }); } - const incompleteOfferings = await prisma.offering.findMany({ - where: { brandId, isEnabled: true, coverUrl: null }, - select: { id: true, name: true }, - }); - for (const [index, item] of incompleteOfferings.entries()) { - const image = offerings[index % offerings.length]?.image; - if (!image) throw new Error("Development fixture has no offering image"); + // 旧模板迁移后可能留下数组形态的 config 或失效媒体引用。开发种子只修复结构, + // 不删除品牌内容,也不擅自重新启用已停用的业务提供项。 + const allOfferings = await prisma.offering.findMany({ where: { brandId } }); + const fallbackImage = offerings[0]?.image; + if (!fallbackImage) throw new Error("Development fixture has no offering image"); + for (const offering of allOfferings) { + const rawConfig = offering.config; + const config = + rawConfig && typeof rawConfig === "object" && !Array.isArray(rawConfig) + ? (rawConfig as Record) + : {}; + const media = config.media; + const hasValidMedia = + Array.isArray(media) && + media.length > 0 && + media.every( + (entry) => + entry && + typeof entry === "object" && + !Array.isArray(entry) && + seedMediaExists((entry as Record).url), + ); + const hasValidCover = seedMediaExists(offering.coverUrl); + const coverUrl = hasValidCover ? (offering.coverUrl as string) : fallbackImage; + if (hasValidCover && hasValidMedia && !Array.isArray(rawConfig)) continue; await prisma.offering.update({ - where: { id: item.id }, + where: { id: offering.id }, data: { - coverUrl: image, + coverUrl, config: { - categoryKey: "custom", - keywords: [], - media: [{ url: image, alt: item.name, type: "image" }], - sections: [], - }, + ...config, + ...(config.categoryKey === undefined ? { categoryKey: "custom" } : {}), + ...(Array.isArray(config.keywords) ? {} : { keywords: [] }), + media: [{ url: coverUrl, alt: offering.name, type: "image" }], + ...(Array.isArray(config.sections) ? {} : { sections: [] }), + } as Prisma.InputJsonValue, }, }); } @@ -812,10 +842,12 @@ async function ensureTemplateInstallation(brandId: string): Promise { throw new Error("Development brand installation does not satisfy the template contract"); return; } - const packageVersion = await prisma.templatePackageVersion.findFirst({ - where: { packageKey: visualKey, status: "published" }, - orderBy: { importedAt: "desc" }, - }); + // 版本升级必须按 SemVer 判断最新版,导入时间只用于同版本排序。 + const packageVersion = latestTemplateVersion( + await prisma.templatePackageVersion.findMany({ + where: { packageKey: visualKey, status: "published" }, + }), + ); if (!packageVersion) throw new Error(`Development brand requires a published package version: ${visualKey}`); const configSnapshot = packageVersion.manifestSnapshot as Prisma.InputJsonValue; diff --git a/apps/api/src/admin.dto.ts b/apps/api/src/admin.dto.ts index d83cc87..43bd07a 100644 --- a/apps/api/src/admin.dto.ts +++ b/apps/api/src/admin.dto.ts @@ -11,6 +11,7 @@ import { MinLength, Matches, Max, + MaxLength, Min, } from "class-validator"; import { brandTemplateKeys } from "@personal-brand/config"; @@ -53,6 +54,26 @@ export class CreateBrandMemberDto { @IsIn(["owner", "editor"]) role!: "owner" | "editor"; } +export class CreateBrandDto { + @IsString() + @MinLength(1) + @MaxLength(80) + name!: string; + + @IsString() + @Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, { + message: "slug 只能包含小写字母、数字和连字符", + }) + @MaxLength(80) + slug!: string; + + @IsIn(brandTemplateKeys) + businessType!: BrandTemplateKey; + + @IsUUID() + templatePackageVersionId!: string; +} + export class ChangeAdminPasswordDto { @IsString() currentPassword!: string; @IsString() @MinLength(8) newPassword!: string; diff --git a/apps/api/src/modules/tenant/tenant.controller.ts b/apps/api/src/modules/tenant/tenant.controller.ts index a35b11d..0543aa3 100644 --- a/apps/api/src/modules/tenant/tenant.controller.ts +++ b/apps/api/src/modules/tenant/tenant.controller.ts @@ -3,7 +3,8 @@ import { Body, Controller, Get, Param, Patch, Post, Req, Res } from "@nestjs/com import type { FastifyReply, FastifyRequest } from "fastify"; import { setAdminSessionCookie } from "../../admin-session-cookie.js"; import { requireAdminIdentity } from "../../admin-access.identity.js"; -import { CreateBrandMemberDto, UpdateBrandMemberDto } from "../../admin.dto.js"; +import { signIdentity } from "../../auth.js"; +import { CreateBrandDto, CreateBrandMemberDto, UpdateBrandMemberDto } from "../../admin.dto.js"; import { TenantService } from "./tenant.service.js"; @AdminBrand() @@ -11,10 +12,38 @@ import { TenantService } from "./tenant.service.js"; export class TenantController { constructor(private readonly tenants: TenantService) {} + @AdminRoles(["owner"]) + @Get("creation-options") + async creationOptions(): Promise { + return this.tenants.getCreationOptions(); + } + + @AdminRoles(["owner"]) + @Post() + async create( + @Req() request: FastifyRequest, + @Body() body: CreateBrandDto, + @Res({ passthrough: true }) reply: FastifyReply, + ): Promise<{ role: string; brand: unknown }> { + const identity = adminIdentity(request); + const requestId = request.headers["x-request-id"]?.toString() ?? request.id; + const brand = await this.tenants.createBrand(identity, body, requestId); + setAdminSessionCookie( + reply, + signIdentity({ + subject: identity.subject, + brandId: brand.id, + role: "admin", + ...(identity.tokenVersion === undefined ? {} : { tokenVersion: identity.tokenVersion }), + }), + ); + return { role: "owner", brand }; + } + @AdminRoles(["owner", "admin", "platform-admin"]) @Get("members") async listMembers(@Req() request: FastifyRequest): Promise { - const current = this.adminIdentity(request); + const current = adminIdentity(request); return this.tenants.listMembers(current.brandId); } @@ -24,7 +53,7 @@ export class TenantController { @Req() request: FastifyRequest, @Body() body: CreateBrandMemberDto, ): Promise { - const actor = this.adminIdentity(request); + const actor = adminIdentity(request); return this.tenants.createMember(actor.brandId, body); } @@ -35,13 +64,13 @@ export class TenantController { @Param("id") id: string, @Body() body: UpdateBrandMemberDto, ): Promise { - const actor = this.adminIdentity(request); + const actor = adminIdentity(request); return this.tenants.updateMember(actor.brandId, actor.subject, id, body); } @Get() async list(@Req() request: FastifyRequest): Promise { - const identity = this.adminIdentity(request); + const identity = adminIdentity(request); return this.tenants.listMemberships(identity.subject); } @@ -51,13 +80,13 @@ export class TenantController { @Param("brandId") brandId: string, @Res({ passthrough: true }) reply: FastifyReply, ): Promise<{ role: string; brand: unknown }> { - const identity = this.adminIdentity(request); + const identity = adminIdentity(request); const result = await this.tenants.switchBrand(identity, brandId); setAdminSessionCookie(reply, result.token); return { role: result.role, brand: result.brand }; } +} - private adminIdentity(request: FastifyRequest) { - return requireAdminIdentity(request); - } +function adminIdentity(request: FastifyRequest) { + return requireAdminIdentity(request); } diff --git a/apps/api/src/modules/tenant/tenant.service.ts b/apps/api/src/modules/tenant/tenant.service.ts index aca8501..83e591a 100644 --- a/apps/api/src/modules/tenant/tenant.service.ts +++ b/apps/api/src/modules/tenant/tenant.service.ts @@ -5,15 +5,107 @@ import { Injectable, } from "@nestjs/common"; import bcrypt from "bcryptjs"; +import { Prisma } from "@prisma/client"; +import { getBrandTemplate } from "@personal-brand/config"; import { PrismaService } from "../../prisma.service.js"; import { signIdentity } from "../../auth.js"; -import type { CreateBrandMemberDto, UpdateBrandMemberDto } from "../../admin.dto.js"; +import type { + CreateBrandDto, + CreateBrandMemberDto, + UpdateBrandMemberDto, +} from "../../admin.dto.js"; +import { TemplateWorkspaceService } from "../../template-workspace.service.js"; type AdminIdentity = { subject: string; brandId: string; tokenVersion?: number }; @Injectable() export class TenantService { - constructor(private readonly prisma: PrismaService) {} + constructor( + private readonly prisma: PrismaService, + private readonly templateWorkspace: TemplateWorkspaceService, + ) {} + + async getCreationOptions() { + const catalog = await this.templateWorkspace.getPageSchemeCatalog(); + // 创建品牌只应从每个页面方案的最新已发布版本开始;旧版本仍可在页面方案页显式切换。 + return { + ...catalog, + pageSchemes: catalog.pageSchemes.filter((scheme) => scheme.isLatestForPackage), + }; + } + + async createBrand(identity: AdminIdentity, body: CreateBrandDto, requestId?: string) { + const template = getBrandTemplate(body.businessType); + if (!template) throw new BadRequestException("业务类型不存在"); + const name = body.name.trim(); + const slug = body.slug.trim(); + if (!name || !slug) throw new BadRequestException("品牌名称和小程序地址标识不能为空"); + const packageVersion = await this.templateWorkspace.resolveInstallablePackageVersion( + body.businessType, + body.templatePackageVersionId, + ); + + try { + return await this.prisma.$transaction(async (tx) => { + const brand = await tx.brandProfile.create({ + data: { + name, + slug, + templateKey: body.businessType, + config: {}, + }, + }); + await tx.brandTemplateInstallation.create({ + data: { + brandId: brand.id, + templateKey: body.businessType, + templateVersion: packageVersion.version, + templatePackageVersionId: packageVersion.id, + contentChecksum: packageVersion.contentChecksum, + configSnapshot: packageVersion.manifestSnapshot as Prisma.InputJsonValue, + }, + }); + await tx.brandFieldDefinition.createMany({ + data: template.fields.map(({ scope, key, label, type, required }, sortOrder) => ({ + brandId: brand.id, + scope, + key, + label, + type, + required, + sortOrder, + source: "core", + })), + }); + await tx.brandMembership.create({ + data: { + adminUserId: identity.subject, + brandId: brand.id, + role: "owner", + isEnabled: true, + }, + }); + await tx.templatePackageAuditLog.create({ + data: { + templatePackageVersionId: packageVersion.id, + actorId: identity.subject, + action: "brand_created", + ...(requestId ? { requestId } : {}), + metadata: { + brandId: brand.id, + businessType: body.businessType, + slug: brand.slug, + }, + }, + }); + return brand; + }); + } catch (error) { + if (error instanceof Prisma.PrismaClientKnownRequestError && error.code === "P2002") + throw new ConflictException("小程序地址标识已被使用,请更换后重试"); + throw error; + } + } listMembers(brandId: string) { return this.prisma.brandMembership.findMany({ diff --git a/apps/api/src/modules/workspace/admin-template.controller.ts b/apps/api/src/modules/workspace/admin-template.controller.ts index 8685d04..689ab86 100644 --- a/apps/api/src/modules/workspace/admin-template.controller.ts +++ b/apps/api/src/modules/workspace/admin-template.controller.ts @@ -10,6 +10,13 @@ import { requireAdminIdentity } from "../../admin-access.identity.js"; class AdminTemplateController { constructor(private readonly templateWorkspace: TemplateWorkspaceService) {} + @AdminRoles(["owner", "admin", "platform-admin"]) + @Get("template/options") + options(@Req() request: FastifyRequest): Promise { + return this.templateWorkspace.getPageSchemeOptions(requireAdminIdentity(request).brandId); + } + + @AdminRoles(["owner", "admin", "platform-admin"]) @Get("template/preview") preview(@Req() request: FastifyRequest): Promise { return this.templateWorkspace.preview(requireAdminIdentity(request).brandId); diff --git a/apps/api/src/template-version-order.ts b/apps/api/src/template-version-order.ts new file mode 100644 index 0000000..814fd73 --- /dev/null +++ b/apps/api/src/template-version-order.ts @@ -0,0 +1,60 @@ +const SEMVER_PATTERN = + /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/; +const fallbackVersionCollator = new Intl.Collator("en", { + numeric: true, + sensitivity: "base", +}); + +type VersionOrderable = { + version: string; + importedAt?: Date; + createdAt?: Date; +}; + +function comparePrerelease(left: string, right: string) { + if (left === right) return 0; + if (!left) return 1; + if (!right) return -1; + const leftParts = left.split("."); + const rightParts = right.split("."); + for (let index = 0; index < Math.max(leftParts.length, rightParts.length); index += 1) { + const leftPart = leftParts[index]; + const rightPart = rightParts[index]; + if (leftPart === undefined) return -1; + if (rightPart === undefined) return 1; + if (leftPart === rightPart) continue; + const leftNumeric = /^\d+$/.test(leftPart); + const rightNumeric = /^\d+$/.test(rightPart); + if (leftNumeric && rightNumeric) return Number(leftPart) - Number(rightPart); + if (leftNumeric !== rightNumeric) return leftNumeric ? -1 : 1; + return leftPart.localeCompare(rightPart); + } + return 0; +} + +export function compareTemplateVersions(left: string, right: string) { + const leftMatch = SEMVER_PATTERN.exec(left); + const rightMatch = SEMVER_PATTERN.exec(right); + if (!leftMatch || !rightMatch) return fallbackVersionCollator.compare(left, right); + for (let index = 1; index <= 3; index += 1) { + const difference = Number(leftMatch[index]) - Number(rightMatch[index]); + if (difference !== 0) return difference; + } + return comparePrerelease(leftMatch[4] ?? "", rightMatch[4] ?? ""); +} + +/** 按 SemVer 从新到旧排序;同版本使用导入和创建时间保证顺序稳定。 */ +export function compareTemplateVersionOrder(left: VersionOrderable, right: VersionOrderable) { + const versionOrder = compareTemplateVersions(right.version, left.version); + if (versionOrder !== 0) return versionOrder; + const importedOrder = (right.importedAt?.getTime() ?? 0) - (left.importedAt?.getTime() ?? 0); + if (importedOrder !== 0) return importedOrder; + return (right.createdAt?.getTime() ?? 0) - (left.createdAt?.getTime() ?? 0); +} + +export function latestTemplateVersion(versions: readonly T[]) { + return versions.reduce((latest, current) => { + if (!latest || compareTemplateVersionOrder(current, latest) < 0) return current; + return latest; + }, undefined); +} diff --git a/apps/api/src/template-workspace.service.ts b/apps/api/src/template-workspace.service.ts index 935e71f..6da304e 100644 --- a/apps/api/src/template-workspace.service.ts +++ b/apps/api/src/template-workspace.service.ts @@ -3,6 +3,7 @@ import type { TemplatePackageVersion } from "@prisma/client"; import { Prisma } from "@prisma/client"; import { type BrandTemplateKey, + brandTemplateKeys, getBrandTemplate, getVisualTemplate, getVisualTemplateManifest, @@ -14,10 +15,99 @@ import type { CreateTrustContentDto, UpdateTrustContentDto } from "./admin.dto.j import type { RollbackTemplateDto, UpgradeTemplateDto } from "./admin.dto.js"; import { PrismaService } from "./prisma.service.js"; import { recordTemplateOperationFailure } from "./modules/admin/template-operation-failure.js"; +import { compareTemplateVersions, latestTemplateVersion } from "./template-version-order.js"; @Injectable() export class TemplateWorkspaceService { constructor(private readonly prisma: PrismaService) {} + + async getPageSchemeCatalog() { + const versions = await this.prisma.templatePackageVersion.findMany({ + where: { status: "published" }, + orderBy: [{ importedAt: "desc" }, { createdAt: "desc" }], + }); + const candidates = versions.flatMap((version) => { + const manifest = record(version.manifestSnapshot); + const visualTemplateKey = manifest.visualTemplateKey; + if ( + manifest.packageKey !== version.packageKey || + manifest.version !== version.version || + typeof visualTemplateKey !== "string" || + visualTemplateKey !== version.packageKey + ) + return []; + const visualTemplate = getVisualTemplate(visualTemplateKey); + const visualManifest = getVisualTemplateManifest(visualTemplateKey); + if (!visualTemplate || !visualManifest) return []; + const supportedBusinessTypes = Array.isArray(manifest.supportedIndustryTemplates) + ? manifest.supportedIndustryTemplates.filter( + (value): value is BrandTemplateKey => + typeof value === "string" && + brandTemplateKeys.includes(value) && + Boolean(getBrandTemplate(value)), + ) + : []; + if ( + supportedBusinessTypes.length === 0 || + supportedBusinessTypes.some( + (businessType) => !isVisualTemplateCompatible(visualTemplate, businessType), + ) || + validateTemplatePackageManifest(manifest).length > 0 + ) + return []; + return [ + { + templatePackageVersionId: version.id, + packageKey: version.packageKey, + name: version.displayName, + description: visualManifest.description, + version: version.version, + supportedBusinessTypes, + }, + ]; + }); + const latestByPackage = new Map(); + for (const candidate of candidates) { + const latestVersion = latestByPackage.get(candidate.packageKey); + if (!latestVersion || compareTemplateVersions(candidate.version, latestVersion) > 0) { + latestByPackage.set(candidate.packageKey, candidate.version); + } + } + const pageSchemes = candidates.map(({ packageKey, ...candidate }) => ({ + ...candidate, + isLatestForPackage: latestByPackage.get(packageKey) === candidate.version, + })); + + return { + businesses: brandTemplateKeys.map((key) => { + const template = getBrandTemplate(key); + if (!template) throw new BadRequestException("业务类型配置不完整"); + return { key, name: template.name, description: template.description }; + }), + pageSchemes, + }; + } + + async getPageSchemeOptions(brandId: string) { + const brand = await this.prisma.brandProfile.findUnique({ + where: { id: brandId }, + select: { templateKey: true }, + }); + const template = brand ? getBrandTemplate(brand.templateKey) : undefined; + if (!brand || !template) throw new BadRequestException("品牌业务类型无效"); + const catalog = await this.getPageSchemeCatalog(); + return { + business: { + key: template.key, + name: template.name, + description: template.description, + }, + pageSchemes: catalog.pageSchemes.filter((scheme) => + scheme.supportedBusinessTypes.includes(template.key), + ), + }; + } + async getTrustContentTypes(brandId: string): Promise { const installation = await this.prisma.brandTemplateInstallation.findUnique({ where: { brandId }, @@ -124,6 +214,7 @@ export class TemplateWorkspaceService { select: { templateKey: true }, }), ]); + if (!brand) throw new BadRequestException("品牌不存在"); // 一个品牌只使用一个行业模板(BrandProfile.templateKey 即身份)。安装只允许补建当前模板的版本台账, // 不得换成别的行业模板,否则会出现「身份是 A、台账是 B」的漂移,并把发布快照接到不适配的视觉模板上。 const currentTemplate = brand?.templateKey ? getBrandTemplate(brand.templateKey) : undefined; @@ -147,15 +238,11 @@ export class TemplateWorkspaceService { ) throw new BadRequestException("当前视觉模板不适配行业模板"); return this.prisma.$transaction(async (tx) => { - await tx.brandProfile.update({ - where: { id: brandId }, - data: { templateKey }, - }); const installation = await tx.brandTemplateInstallation.create({ data: { brandId, templateKey, - templateVersion: template.version, + templateVersion: packageVersion.version, templatePackageVersionId: packageVersion.id, contentChecksum: packageVersion.contentChecksum, configSnapshot: packageVersion.manifestSnapshot as Prisma.InputJsonValue, @@ -176,7 +263,7 @@ export class TemplateWorkspaceService { return { installation, template, visualTemplate: visualManifest }; }); } - private async resolveInstallablePackageVersion( + async resolveInstallablePackageVersion( templateKey: BrandTemplateKey, templatePackageVersionId: string, ): Promise { @@ -195,7 +282,7 @@ export class TemplateWorkspaceService { !Array.isArray(manifest.supportedIndustryTemplates) || !manifest.supportedIndustryTemplates.includes(templateKey) ) { - throw new BadRequestException("模板包版本与行业或视觉模板不匹配"); + throw new BadRequestException("页面方案与所选业务类型不兼容,请重新选择"); } if (validateTemplatePackageManifest(manifest).length) throw new BadRequestException("模板包版本不符合统一模板契约"); @@ -253,11 +340,17 @@ export class TemplateWorkspaceService { if (!target || target.status !== "published") throw new BadRequestException("指定模板包版本不存在或未发布"); const manifest = record(target.manifestSnapshot) as unknown as TemplatePackageManifest; + const visualTemplate = + typeof manifest.visualTemplateKey === "string" + ? getVisualTemplate(manifest.visualTemplateKey) + : undefined; if ( target.packageKey !== manifest.packageKey || target.version !== manifest.version || manifest.packageKey !== manifest.visualTemplateKey || !manifest.supportedIndustryTemplates?.includes(brand.templateKey) || + !visualTemplate || + !isVisualTemplateCompatible(visualTemplate, brand.templateKey) || validateTemplatePackageManifest(manifest).length ) throw new BadRequestException("指定模板包版本不符合当前品牌的统一模板契约"); @@ -329,15 +422,28 @@ export class TemplateWorkspaceService { ).visualTemplateKey; if (typeof visualTemplateKey !== "string") throw new BadRequestException("已安装模板版本缺少 visualTemplateKey 声明"); - const [currentPackage, targetPackage] = await Promise.all([ + const [currentPackage, publishedTargets] = await Promise.all([ this.prisma.templatePackageVersion.findUnique({ where: { id: installation.templatePackageVersionId }, }), - this.prisma.templatePackageVersion.findFirst({ + this.prisma.templatePackageVersion.findMany({ where: { packageKey: visualTemplateKey, status: "published" }, - orderBy: { importedAt: "desc" }, }), ]); + const targetPackage = latestTemplateVersion( + publishedTargets.filter((candidate) => { + const manifest = record(candidate.manifestSnapshot); + return ( + candidate.packageKey === visualTemplateKey && + manifest.packageKey === candidate.packageKey && + manifest.version === candidate.version && + manifest.visualTemplateKey === visualTemplateKey && + Array.isArray(manifest.supportedIndustryTemplates) && + manifest.supportedIndustryTemplates.includes(installation.templateKey) && + validateTemplatePackageManifest(manifest).length === 0 + ); + }), + ); if (!currentPackage) throw new BadRequestException("当前安装引用的模板包版本不存在"); if ( currentPackage.packageKey !== visualTemplateKey || @@ -507,7 +613,7 @@ export class TemplateWorkspaceService { }) .sort(); if (JSON.stringify(expectedConflicts) !== JSON.stringify(preserved)) - throw new ConflictException("冲突处理与当前预览不一致,请重新预览并逐项确认"); + throw new ConflictException("冲突处理与当前预览不一致,请重新预览后再升级"); const manifest = record(target.manifestSnapshot); if ( target.packageKey !== diff --git a/apps/api/test/api-routes.test.ts b/apps/api/test/api-routes.test.ts index be66909..31ef17c 100644 --- a/apps/api/test/api-routes.test.ts +++ b/apps/api/test/api-routes.test.ts @@ -12,11 +12,20 @@ import { AdminCapabilityController } from "../src/modules/workspace/admin-capabi import { AdminOfferingController } from "../src/modules/workspace/admin-offering.controller.js"; import { AdminInquiryController } from "../src/modules/workspace/admin-inquiry.controller.js"; import { AdminTemplatePackageController } from "../src/modules/admin/admin-template-package.controller.js"; +import { TenantController } from "../src/modules/tenant/tenant.controller.js"; const expectedRoutes = new Set([ + "GET /admin/brands/creation-options", + "POST /admin/brands", + "GET /admin/brands/members", + "POST /admin/brands/members", + "PATCH /admin/brands/members/:id", + "GET /admin/brands", + "POST /admin/brands/:brandId/switch", "GET /admin/workspace", "GET /admin/workspace/preview", "POST /admin/workspace/install", + "GET /admin/workspace/template/options", "GET /admin/workspace/template/preview", "POST /admin/workspace/template/upgrade", "POST /admin/workspace/template/rollback", @@ -50,6 +59,7 @@ const expectedRoutes = new Set([ test("refactored admin controllers preserve their declared API routes", () => { const controllers = [ + TenantController, AdminWorkspacePreviewController, AdminTemplateController, AdminCapabilityController, diff --git a/apps/api/test/http.integration.test.js b/apps/api/test/http.integration.test.js index 0eadc0e..767300f 100644 --- a/apps/api/test/http.integration.test.js +++ b/apps/api/test/http.integration.test.js @@ -137,11 +137,12 @@ test("模板目录只允许平台模板管理员访问,并支持安全、幂 const baseline = JSON.parse(empty.body); assert.deepEqual(baseline.items.map((item) => item.packageKey).sort(), [ "acheng-campus-food", + "atelier-solopreneur", "linjing-editorial", ]); const linjingVersion = baseline.items.find((item) => item.packageKey === "linjing-editorial"); assert.ok(linjingVersion); - assert.equal(linjingVersion.version, "1.0.6"); + assert.equal(linjingVersion.version, "1.0.7"); const linjingPreview = await request( `/admin/templates/${linjingVersion.id}/preview?industry=doors`, { headers }, @@ -380,15 +381,12 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 assert.equal(rejectedImport.statusCode, 400, rejectedImport.body); assert.match(JSON.parse(rejectedImport.body).error.message, /previewFixture/); assert.equal(await prisma.templatePackageVersion.count(), versionCount); - const archive = createTemplateArchive("atelier-solopreneur"); - const multipart = multipartArchive(archive); - const imported = await request("/admin/templates/import", { - method: "POST", - headers: { ...headers, ...multipart.headers }, - rawPayload: multipart.payload, + // 预览只允许使用平台当前已部署的精确 renderer 版本;复用 prepare 阶段导入的基线版本, + // 避免测试自造一个 renderer 尚未部署的新版本。 + const baselineVersion = await prisma.templatePackageVersion.findFirstOrThrow({ + where: { packageKey: "atelier-solopreneur", version: "1.3.2", status: "published" }, }); - assert.equal(imported.statusCode, 201); - const versionId = JSON.parse(imported.body).version.id; + const versionId = baselineVersion.id; const businessCounts = () => Promise.all([ @@ -625,21 +623,17 @@ test("平台模板管理员可以按行业预览版本,且预览不写入品 assert.match(JSON.parse(incompatible.body).error.message, /不支持所选行业/); assert.deepEqual(await businessCounts(), before); + const repeatedPublish = await request(`/admin/templates/${versionId}/publish`, { + method: "POST", + headers, + }); + assert.equal(repeatedPublish.statusCode, 201); + assert.equal(JSON.parse(repeatedPublish.body).changed, false); const retired = await request(`/admin/templates/${versionId}/retire`, { method: "POST", headers, }); - assert.equal(retired.statusCode, 409); - const published = await request(`/admin/templates/${versionId}/publish`, { - method: "POST", - headers, - }); - assert.equal(published.statusCode, 201); - const retiredAfterPublish = await request(`/admin/templates/${versionId}/retire`, { - method: "POST", - headers, - }); - assert.equal(retiredAfterPublish.statusCode, 201); + assert.equal(retired.statusCode, 201); const retiredPreview = await request(`/admin/templates/${versionId}/preview?industry=personal`, { headers, }); @@ -1988,7 +1982,7 @@ test("visual template compatibility is enforced by catalog, preview, and version } assert.deepEqual( visuals.find((visual) => visual.key === "linjing-editorial").supportedIndustryTemplates, - ["personal", "doors"], + ["doors"], ); const incompatiblePreview = await request( "/public/templates/preview?industry=food&visual=linjing-editorial", @@ -2149,6 +2143,337 @@ test("seeded public workspaces keep personal, food, and doors brands isolated", assert.equal(new Set(workspaces.map((workspace) => workspace.brand.id)).size, 2); }); +test("brand creation options are owner-scoped", async () => { + const unauthorized = await request("/admin/brands/creation-options"); + assert.equal(unauthorized.statusCode, 401); + const customerForbidden = await request("/admin/brands/creation-options", { + headers: { authorization: `Bearer ${customerToken}` }, + }); + assert.equal(customerForbidden.statusCode, 403); + + const ownerLogin = await request("/admin/session/login", { + method: "POST", + payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, + }); + const ownerToken = sessionToken(ownerLogin); + const editorUser = await prisma.adminUser.create({ + data: { + username: `creation-options-editor-${randomUUID()}`, + passwordHash: "unused", + displayName: "建品牌权限测试编辑", + mustChangePassword: false, + }, + }); + const editorMembership = await prisma.brandMembership.create({ + data: { adminUserId: editorUser.id, brandId, role: "editor" }, + }); + try { + const editorToken = signIdentity({ + subject: editorUser.id, + brandId, + role: "admin", + tokenVersion: editorUser.tokenVersion, + }); + const editorForbidden = await request("/admin/brands/creation-options", { + headers: { authorization: `Bearer ${editorToken}` }, + }); + assert.equal(editorForbidden.statusCode, 403); + + const response = await request("/admin/brands/creation-options", { + headers: { authorization: `Bearer ${ownerToken}` }, + }); + assert.equal(response.statusCode, 200, response.body); + const options = JSON.parse(response.body); + assert.deepEqual(options.businesses.map((business) => business.key).sort(), [ + "doors", + "food", + "personal", + ]); + assert.ok(options.businesses.every((business) => business.name && business.description)); + // 创建品牌只暴露每个页面方案的最新版本,避免新品牌起步在旧版本上。 + assert.equal(options.pageSchemes.length, 3, JSON.stringify(options.pageSchemes)); + const linjingScheme = options.pageSchemes.find((scheme) => scheme.name.includes("林境")); + assert.ok(linjingScheme); + assert.equal(linjingScheme.version, "1.0.7"); + assert.deepEqual(linjingScheme.supportedBusinessTypes, ["doors"]); + assert.equal(linjingScheme.isLatestForPackage, true); + const atelierScheme = options.pageSchemes.find((scheme) => scheme.name.includes("工坊")); + assert.ok(atelierScheme); + assert.equal(atelierScheme.version, "1.3.2"); + assert.deepEqual(atelierScheme.supportedBusinessTypes, ["personal"]); + assert.equal( + options.pageSchemes.some( + (scheme) => + scheme.supportedBusinessTypes.includes("personal") && + scheme.supportedBusinessTypes.includes("doors"), + ), + false, + "页面方案不应同时兼容 personal 和 doors", + ); + assert.equal(JSON.stringify(options).includes("visualTemplateKey"), false); + assert.equal(JSON.stringify(options).includes("packageKey"), false); + } finally { + await prisma.brandMembership.delete({ where: { id: editorMembership.id } }); + await prisma.adminUser.delete({ where: { id: editorUser.id } }); + } +}); + +test("owner can create an isolated brand", async () => { + const startedAt = new Date(); + const suffix = randomUUID().slice(0, 8); + const personalSlug = `atelier-created-${suffix}`; + const doorsSlug = `linjing-created-${suffix}`; + // 集成 fixture 必须锁定精确版本,避免导入时间或历史版本影响测试语义。 + const atelier = await prisma.templatePackageVersion.findFirstOrThrow({ + where: { + packageKey: "atelier-solopreneur", + version: "1.3.2", + status: "published", + }, + }); + const linjing = await prisma.templatePackageVersion.findFirstOrThrow({ + where: { + packageKey: "linjing-editorial", + version: "1.0.7", + status: "published", + }, + }); + const ownerLogin = await request("/admin/session/login", { + method: "POST", + payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, + }); + const ownerToken = sessionToken(ownerLogin); + const ownerIdentity = readIdentity(ownerToken); + const unauthorizedPayload = { + name: "未授权品牌", + slug: `unauthorized-${suffix}`, + businessType: "personal", + templatePackageVersionId: atelier.id, + }; + const unauthorized = await request("/admin/brands", { + method: "POST", + payload: unauthorizedPayload, + }); + assert.equal(unauthorized.statusCode, 401); + const customerForbidden = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${customerToken}` }, + payload: unauthorizedPayload, + }); + assert.equal(customerForbidden.statusCode, 403); + const incompatible = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "不兼容品牌", + slug: `incompatible-${suffix}`, + businessType: "personal", + templatePackageVersionId: linjing.id, + }, + }); + assert.equal(incompatible.statusCode, 400, incompatible.body); + assert.match(errorMessage(incompatible.body), /业务类型|页面方案|兼容/); + assert.equal(await prisma.brandProfile.count({ where: { slug: `incompatible-${suffix}` } }), 0); + + try { + const created = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "新建独立工坊", + slug: personalSlug, + businessType: "personal", + templatePackageVersionId: atelier.id, + }, + }); + assert.equal(created.statusCode, 201, created.body); + const createdBrand = JSON.parse(created.body).brand; + assert.equal(createdBrand.slug, personalSlug); + assert.equal(createdBrand.templateKey, "personal"); + + const profile = await prisma.brandProfile.findUniqueOrThrow({ + where: { id: createdBrand.id }, + }); + assert.equal(profile.templateKey, "personal"); + assert.deepEqual(profile.config, {}); + const installation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId: createdBrand.id }, + }); + assert.equal(installation.templateKey, "personal"); + assert.equal(installation.templatePackageVersionId, atelier.id); + assert.equal(installation.templateVersion, atelier.version); + assert.ok( + (await prisma.brandFieldDefinition.count({ where: { brandId: createdBrand.id } })) > 0, + ); + const membership = await prisma.brandMembership.findUniqueOrThrow({ + where: { + adminUserId_brandId: { + adminUserId: ownerIdentity.subject, + brandId: createdBrand.id, + }, + }, + }); + assert.equal(membership.role, "owner"); + assert.equal(membership.isEnabled, true); + const audit = await prisma.templatePackageAuditLog.findFirstOrThrow({ + where: { + templatePackageVersionId: atelier.id, + actorId: ownerIdentity.subject, + action: "brand_created", + createdAt: { gte: startedAt }, + }, + orderBy: { createdAt: "desc" }, + }); + assert.equal(audit.metadata.brandId, createdBrand.id); + assert.equal(audit.metadata.businessType, "personal"); + const newCookie = sessionToken(created); + assert.equal(readIdentity(newCookie).brandId, createdBrand.id); + const current = await request("/admin/config/brand", { + headers: { authorization: `Bearer ${newCookie}` }, + }); + assert.equal(current.statusCode, 200, current.body); + assert.equal(JSON.parse(current.body).id, createdBrand.id); + + const duplicate = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "重复地址品牌", + slug: personalSlug, + businessType: "personal", + templatePackageVersionId: atelier.id, + }, + }); + assert.equal(duplicate.statusCode, 409, duplicate.body); + assert.equal(await prisma.brandProfile.count({ where: { slug: personalSlug } }), 1); + + const invalidBusinessType = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "非法业务品牌", + slug: `invalid-business-${suffix}`, + businessType: "consulting", + templatePackageVersionId: atelier.id, + }, + }); + assert.equal(invalidBusinessType.statusCode, 400); + + const incompatible = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "不兼容页面方案品牌", + slug: `incompatible-${suffix}`, + businessType: "personal", + templatePackageVersionId: linjing.id, + }, + }); + assert.equal(incompatible.statusCode, 400, incompatible.body); + assert.equal(await prisma.brandProfile.count({ where: { slug: `incompatible-${suffix}` } }), 0); + + const doorsCreated = await request("/admin/brands", { + method: "POST", + headers: { authorization: `Bearer ${ownerToken}` }, + payload: { + name: "新建林境门窗", + slug: doorsSlug, + businessType: "doors", + templatePackageVersionId: linjing.id, + }, + }); + assert.equal(doorsCreated.statusCode, 201, doorsCreated.body); + const doorsBrand = JSON.parse(doorsCreated.body).brand; + const doorsInstallation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId: doorsBrand.id }, + }); + assert.equal(doorsInstallation.templateKey, "doors"); + assert.equal(doorsInstallation.templatePackageVersionId, linjing.id); + } finally { + await prisma.templatePackageAuditLog.deleteMany({ + where: { + actorId: ownerIdentity.subject, + action: "brand_created", + createdAt: { gte: startedAt }, + }, + }); + await prisma.brandProfile.deleteMany({ + where: { slug: { in: [personalSlug, doorsSlug] } }, + }); + } +}); + +test("page scheme options are readable by owners and admins only", async () => { + const unauthorized = await request("/admin/workspace/template/options"); + assert.equal(unauthorized.statusCode, 401); + const customerForbidden = await request("/admin/workspace/template/options", { + headers: { authorization: `Bearer ${customerToken}` }, + }); + assert.equal(customerForbidden.statusCode, 403); + const ownerLogin = await request("/admin/session/login", { + method: "POST", + payload: { username: "admin", password: process.env.SEED_ADMIN_PASSWORD }, + }); + const ownerToken = sessionToken(ownerLogin); + const members = []; + + try { + for (const role of ["admin", "editor"]) { + const user = await prisma.adminUser.create({ + data: { + username: `page-scheme-${role}-${randomUUID()}`, + passwordHash: "unused", + displayName: `页面方案${role}测试`, + mustChangePassword: false, + }, + }); + const membership = await prisma.brandMembership.create({ + data: { adminUserId: user.id, brandId, role }, + }); + members.push({ userId: user.id, membershipId: membership.id }); + const token = signIdentity({ + subject: user.id, + brandId, + role: "admin", + tokenVersion: user.tokenVersion, + }); + if (role === "admin") { + const adminResponse = await request("/admin/workspace/template/options", { + headers: { authorization: `Bearer ${token}` }, + }); + assert.equal(adminResponse.statusCode, 200, adminResponse.body); + const adminOptions = JSON.parse(adminResponse.body); + assert.equal(adminOptions.business.key, "food"); + assert.equal(adminOptions.pageSchemes.length > 0, true); + assert.ok( + adminOptions.pageSchemes.every((scheme) => + scheme.supportedBusinessTypes.includes("food"), + ), + ); + } else { + const editorForbidden = await request("/admin/workspace/template/options", { + headers: { authorization: `Bearer ${token}` }, + }); + assert.equal(editorForbidden.statusCode, 403); + } + } + + const ownerResponse = await request("/admin/workspace/template/options", { + headers: { authorization: `Bearer ${ownerToken}` }, + }); + assert.equal(ownerResponse.statusCode, 200, ownerResponse.body); + const ownerOptions = JSON.parse(ownerResponse.body); + assert.equal(ownerOptions.business.key, "food"); + assert.equal(JSON.stringify(ownerOptions).includes("visualTemplateKey"), false); + assert.equal(JSON.stringify(ownerOptions).includes("packageKey"), false); + } finally { + for (const item of members.reverse()) { + await prisma.brandMembership.delete({ where: { id: item.membershipId } }); + await prisma.adminUser.delete({ where: { id: item.userId } }); + } + } +}); + test("public workspace uses brand-scoped capability installations and preserves status", async () => { await prisma.capabilityInstallation.deleteMany({ where: { brandId } }); const installation = await prisma.capabilityInstallation.create({ @@ -2281,6 +2606,10 @@ test("editor membership can manage brand content but cannot change system settin payload: { config: { visualTemplateKey: "unknown-visual" } }, }); assert.equal(visualUpdate.statusCode, 400); + const pageSchemePreview = await request("/admin/workspace/template/preview", { + headers: { authorization: `Bearer ${token}` }, + }); + assert.equal(pageSchemePreview.statusCode, 403); } finally { await prisma.brandMembership.update({ where: { id: membership.id }, @@ -2887,10 +3216,19 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", const initialManifest = structuredClone(installedPackageVersion.manifestSnapshot); initialManifest.version = initialPackageVersion; initialManifest.templateFields = [ - { key: "founder", binding: "brand.config.founder", label: "主理人" }, + { key: "founder", binding: "brand.config.templateData.founder", label: "主理人" }, + ]; + initialManifest.assetSlots = [ + { + key: "brand.logo", + binding: "brand.avatarUrl", + target: "brand", + label: "品牌标志", + help: "用于品牌身份展示。", + required: false, + kind: "logo", + }, ]; - initialManifest.entrypoints = { home: "pages/index/index" }; - initialManifest.assetSlots = [{ key: "brand.logo", binding: "brand.avatarUrl" }]; initialManifest.requiredCapabilities = ["offerings"]; const initialPackageVersionRecord = await prisma.templatePackageVersion.create({ data: { @@ -2911,9 +3249,20 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", const originalConfig = originalBrand.config && typeof originalBrand.config === "object" ? originalBrand.config : {}; const existingFounder = "升级前的品牌主理人"; + const originalTemplateData = + originalConfig.templateData && + typeof originalConfig.templateData === "object" && + !Array.isArray(originalConfig.templateData) + ? originalConfig.templateData + : {}; await prisma.brandProfile.update({ where: { id: brandId }, - data: { config: { ...originalConfig, founder: existingFounder } }, + data: { + config: { + ...originalConfig, + templateData: { ...originalTemplateData, founder: existingFounder }, + }, + }, }); await prisma.brandTemplateInstallation.update({ where: { id: installedRecord.id }, @@ -2927,15 +3276,32 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", const targetManifest = structuredClone(initialManifest); targetManifest.version = packageVersion; targetManifest.templateFields = [ - { key: "founder", binding: "brand.config.founder", label: "品牌主理人" }, + { key: "founder", binding: "brand.config.templateData.founder", label: "品牌主理人" }, ]; targetManifest.entrypoints = { + ...initialManifest.entrypoints, home: "pages/home/index", - profile: "pages/profile/index", + gallery: "pages/gallery/index", }; targetManifest.assetSlots = [ - { key: "brand.logo", binding: "brand.avatarUrl" }, - { key: "home.hero", binding: "brand.config.heroImage" }, + { + key: "brand.logo", + binding: "brand.avatarUrl", + target: "brand", + label: "品牌标志", + help: "用于品牌身份展示。", + required: false, + kind: "logo", + }, + { + key: "home.hero", + binding: "brand.config.heroImage", + target: "brand", + label: "首页主图", + help: "用于首页展示品牌重点内容。", + required: false, + kind: "image", + }, ]; targetManifest.requiredCapabilities = []; const packageVersionRecord = await prisma.templatePackageVersion.create({ @@ -2962,7 +3328,7 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", assert.equal(actionable.targetPackageVersionId, packageVersionRecord.id); assert.equal(actionable.changes.brandFields.available, false); assert.equal(actionable.conflicts.length, 1); - assert.equal(actionable.conflicts[0].binding, "brand.config.founder"); + assert.equal(actionable.conflicts[0].binding, "brand.config.templateData.founder"); assert.equal(actionable.changes.pages.added.length, 1); assert.equal(actionable.changes.assets.slots.added.length, 1); assert.deepEqual(actionable.changes.capabilities.removed, ["offerings"]); @@ -3001,7 +3367,9 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", expectedCurrentVersion: actionable.currentVersion, expectedCurrentPackageVersionId: actionable.currentPackageVersionId, confirm: true, - preservedBindings: [{ key: "founder", binding: "brand.config.founder", action: "preserve" }], + preservedBindings: [ + { key: "founder", binding: "brand.config.templateData.founder", action: "preserve" }, + ], }; const upgradeAttempts = await Promise.all( [0, 1].map(() => @@ -3020,7 +3388,8 @@ test("template ledger install, upgrade preview, and rollback stay brand-scoped", packageVersionRecord.id, ); assert.equal( - (await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).config.founder, + (await prisma.brandProfile.findUniqueOrThrow({ where: { id: brandId } })).config.templateData + .founder, existingFounder, ); const retainedOldPackage = await prisma.templatePackageVersion.findUniqueOrThrow({ @@ -3391,6 +3760,86 @@ test("selected package version is reflected in public runtime workspace", async assert.equal(body.visualTemplateManifest.key, selectedVersion.manifestSnapshot.visualTemplateKey); }); +test("legacy doors installation preview separates content package and platform renderer versions", async () => { + const doorsBrand = await prisma.brandProfile.findUniqueOrThrow({ + where: { slug: "linjing-doors" }, + }); + const adminUser = await prisma.adminUser.findUniqueOrThrow({ where: { username: "admin" } }); + const installation = await prisma.brandTemplateInstallation.findUniqueOrThrow({ + where: { brandId: doorsBrand.id }, + }); + const currentPackage = await prisma.templatePackageVersion.findFirstOrThrow({ + where: { + packageKey: "linjing-editorial", + version: "1.0.7", + status: "published", + }, + }); + // 模拟真实旧安装:内容包锁定 1.0.6,但平台 renderer 已是 1.0.7。 + const legacyManifest = { + ...currentPackage.manifestSnapshot, + version: "1.0.6", + supportedIndustryTemplates: ["personal", "doors"], + }; + const legacyPackage = await prisma.templatePackageVersion.create({ + data: { + templatePackageId: currentPackage.templatePackageId, + packageKey: currentPackage.packageKey, + version: "1.0.6", + displayName: currentPackage.displayName, + status: "published", + manifestSnapshot: legacyManifest, + validationReport: currentPackage.validationReport, + contentChecksum: `legacy-${randomUUID()}`, + archiveChecksum: `legacy-archive-${randomUUID()}`, + artifactPath: currentPackage.artifactPath, + importedById: adminUser.id, + }, + }); + const headers = { + authorization: `Bearer ${signIdentity({ + subject: adminUser.id, + brandId: doorsBrand.id, + role: "admin", + tokenVersion: adminUser.tokenVersion, + })}`, + }; + try { + await prisma.brandTemplateInstallation.update({ + where: { brandId: doorsBrand.id }, + data: { + templateVersion: legacyPackage.version, + templatePackageVersionId: legacyPackage.id, + contentChecksum: legacyPackage.contentChecksum, + configSnapshot: legacyPackage.manifestSnapshot, + }, + }); + + const previewResponse = await request("/admin/workspace/template/preview", { headers }); + assert.equal(previewResponse.statusCode, 200, previewResponse.body); + const preview = JSON.parse(previewResponse.body); + assert.equal(preview.currentVersion, "1.0.6"); + assert.equal(preview.latestVersion, "1.0.7"); + assert.equal(preview.canUpgrade, true); + assert.equal(preview.targetPackageVersionId, currentPackage.id); + assert.equal(preview.changes.renderer.available, true); + assert.equal(preview.changes.renderer.source, "platform_visual_manifest"); + assert.equal(preview.changes.renderer.packageUpgradeChangesRenderer, false); + assert.ok(preview.changes.renderer.pages.length > 0); + } finally { + await prisma.brandTemplateInstallation.update({ + where: { brandId: doorsBrand.id }, + data: { + templateVersion: installation.templateVersion, + templatePackageVersionId: installation.templatePackageVersionId, + contentChecksum: installation.contentChecksum, + configSnapshot: installation.configSnapshot, + }, + }); + await prisma.templatePackageVersion.delete({ where: { id: legacyPackage.id } }); + } +}); + test("public workspace exposes declared brand and trust presentation data", async () => { const doorsBrand = await prisma.brandProfile.findUnique({ where: { slug: "linjing-doors" } }); assert.ok(doorsBrand); diff --git a/apps/api/test/local-media-seed.test.ts b/apps/api/test/local-media-seed.test.ts new file mode 100644 index 0000000..4579ded --- /dev/null +++ b/apps/api/test/local-media-seed.test.ts @@ -0,0 +1,25 @@ +import assert from "node:assert/strict"; +import { existsSync, readFileSync } from "node:fs"; +import path from "node:path"; +import { test } from "node:test"; + +const projectRoot = path.resolve(import.meta.dirname, "../../.."); +const seedPath = path.join(projectRoot, "apps/api/prisma/seed.ts"); +const assetDirectory = path.join(projectRoot, "apps/api/prisma/assets"); + +test("开发 seed 引用的本地媒体都有随仓库分发的源文件", () => { + const seed = readFileSync(seedPath, "utf8"); + const references = [...seed.matchAll(/["'](\/media\/seed\/[^"']+)["']/g)].map( + ([, mediaPath]) => mediaPath, + ); + + assert.ok(references.length > 0, "seed 中没有找到本地媒体引用"); + for (const mediaPath of new Set(references)) { + const filename = path.basename(mediaPath); + assert.equal( + existsSync(path.join(assetDirectory, filename)), + true, + `seed 引用的媒体缺少源文件: ${mediaPath}`, + ); + } +}); diff --git a/apps/api/test/prepare-integration-template-packages.mjs b/apps/api/test/prepare-integration-template-packages.mjs index 4802f44..cfbe7ed 100644 --- a/apps/api/test/prepare-integration-template-packages.mjs +++ b/apps/api/test/prepare-integration-template-packages.mjs @@ -10,7 +10,7 @@ import { createApp } from "../dist/main.js"; import { signIdentity } from "../dist/auth.js"; const prisma = new PrismaClient(); -const packageKeys = ["acheng-campus-food", "linjing-editorial"]; +const packageKeys = ["acheng-campus-food", "linjing-editorial", "atelier-solopreneur"]; function run(command, args, options = {}) { const result = spawnSync(command, args, { stdio: "inherit", ...options }); diff --git a/apps/api/test/route-coverage.matrix.ts b/apps/api/test/route-coverage.matrix.ts index b0dec5c..f033584 100644 --- a/apps/api/test/route-coverage.matrix.ts +++ b/apps/api/test/route-coverage.matrix.ts @@ -69,6 +69,14 @@ export const ROUTE_COVERAGE: RouteCoverage[] = [ authorizationTest: "admin can list and switch only enabled brand memberships", successTest: "admin can list and switch only enabled brand memberships", }, + { + method: "GET", + path: "/admin/brands/creation-options", + auth: "roles", + roles: ["owner"], + authorizationTest: "brand creation options are owner-scoped", + successTest: "brand creation options are owner-scoped", + }, { method: "GET", path: "/admin/brands/members", @@ -222,10 +230,19 @@ export const ROUTE_COVERAGE: RouteCoverage[] = [ { method: "GET", path: "/admin/workspace/template/preview", - auth: "brand", + auth: "roles", + roles: ["owner", "admin", "platform-admin"], authorizationTest: "template ledger install, upgrade preview, and rollback stay brand-scoped", successTest: "template ledger install, upgrade preview, and rollback stay brand-scoped", }, + { + method: "GET", + path: "/admin/workspace/template/options", + auth: "roles", + roles: ["owner", "admin", "platform-admin"], + authorizationTest: "page scheme options are readable by owners and admins only", + successTest: "page scheme options are readable by owners and admins only", + }, { method: "GET", path: "/customer/bookings", @@ -436,6 +453,14 @@ export const ROUTE_COVERAGE: RouteCoverage[] = [ authorizationTest: "admin can list and switch only enabled brand memberships", successTest: "admin can list and switch only enabled brand memberships", }, + { + method: "POST", + path: "/admin/brands", + auth: "roles", + roles: ["owner"], + authorizationTest: "owner can create an isolated brand", + successTest: "owner can create an isolated brand", + }, { method: "POST", path: "/admin/brands/members", diff --git a/apps/api/test/run-integration.cjs b/apps/api/test/run-integration.cjs index b270a6d..b5eb142 100644 --- a/apps/api/test/run-integration.cjs +++ b/apps/api/test/run-integration.cjs @@ -1,5 +1,7 @@ const assert = require("node:assert/strict"); const { randomBytes } = require("node:crypto"); +const { existsSync } = require("node:fs"); +const path = require("node:path"); const { spawnSync } = require("node:child_process"); const { PrismaClient } = require("@prisma/client"); @@ -32,7 +34,47 @@ async function main() { const initialTrustCount = await fixtureDatabase.trustContent.count(); const initialFormCount = await fixtureDatabase.inquiryForm.count(); const initialReleases = await fixtureDatabase.brandRelease.findMany({ orderBy: { id: "asc" } }); + // 模拟旧模板遗留数据:数组 config、失效封面和媒体引用。重复 seed 必须修复结构, + // 同时保留记录本身和停用状态。 + const doorsBrand = await fixtureDatabase.brandProfile.findUniqueOrThrow({ + where: { slug: "linjing-doors" }, + }); + const legacyOfferingName = "legacy-offering-repair-fixture"; + await fixtureDatabase.offering.create({ + data: { + brandId: doorsBrand.id, + kind: "service", + name: legacyOfferingName, + coverUrl: "/media/seed/seed-02.jpg", + isEnabled: false, + config: [{ url: "/media/seed/seed-02.jpg" }], + }, + }); if (run("pnpm", ["db:seed"]) !== 0) return status; + const repairedLegacyOffering = await fixtureDatabase.offering.findUniqueOrThrow({ + where: { brandId_name: { brandId: doorsBrand.id, name: legacyOfferingName } }, + }); + assert.equal( + Array.isArray(repairedLegacyOffering.config), + false, + "Repeated seed must repair legacy array config", + ); + assert.ok( + repairedLegacyOffering.config && + typeof repairedLegacyOffering.config === "object" && + Array.isArray(repairedLegacyOffering.config.media), + "Repeated seed must rebuild legacy media config", + ); + assert.notEqual( + repairedLegacyOffering.coverUrl, + "/media/seed/seed-02.jpg", + "Repeated seed must replace a missing local cover", + ); + assert.equal( + repairedLegacyOffering.isEnabled, + false, + "Repeated seed must preserve disabled offering state", + ); assert.equal( await fixtureDatabase.trustContent.count(), initialTrustCount, @@ -48,6 +90,32 @@ async function main() { initialReleases, "Repeated seed must preserve release history and snapshots", ); + const seededOfferings = await fixtureDatabase.offering.findMany({ + select: { name: true, coverUrl: true, config: true }, + }); + assert.ok(seededOfferings.length > 0, "Seed must create offering fixtures"); + for (const offering of seededOfferings) { + assert.ok( + offering.config && typeof offering.config === "object" && !Array.isArray(offering.config), + `Seed offering config must be an object: ${offering.name}`, + ); + const config = offering.config; + const mediaUrls = Array.isArray(config.media) + ? config.media.flatMap((item) => + item && typeof item === "object" && typeof item.url === "string" ? [item.url] : [], + ) + : []; + const localMedia = [offering.coverUrl, ...mediaUrls].filter( + (url) => typeof url === "string" && url.startsWith("/media/seed/"), + ); + for (const mediaPath of new Set(localMedia)) { + assert.equal( + existsSync(path.join(__dirname, "prisma/assets", path.basename(mediaPath))), + true, + `Seed offering references missing media: ${offering.name} -> ${mediaPath}`, + ); + } + } await fixtureDatabase.adminUser.updateMany({ where: { username: "admin" }, data: { mustChangePassword: false }, diff --git a/apps/api/test/template-contract-migration.integration.mjs b/apps/api/test/template-contract-migration.integration.mjs index 85c1eed..b736974 100644 --- a/apps/api/test/template-contract-migration.integration.mjs +++ b/apps/api/test/template-contract-migration.integration.mjs @@ -45,7 +45,7 @@ async function main() { .filter((entry) => entry.isDirectory() && entry.name !== targetMigration) .map((entry) => entry.name) .sort(); - assert.equal(migrationDirs.at(-1), "20261018180000_add_customer_token_version"); + assert.equal(migrationDirs.at(-1), "20261019100000_remove_brand_profile_defaults"); await admin.$executeRawUnsafe(`CREATE SCHEMA "${schema}"`); createdSchema = true; diff --git a/apps/api/test/template-preview-matrix.test.ts b/apps/api/test/template-preview-matrix.test.ts index 888fe89..447de21 100644 --- a/apps/api/test/template-preview-matrix.test.ts +++ b/apps/api/test/template-preview-matrix.test.ts @@ -180,8 +180,8 @@ test("template preview matrix keeps every deployed package, industry, and versio } } } - // 3 个包 x 支持行业(1 + 1 + 2)x 2 个版本 = 8 个隔离模拟品牌。 - assert.equal(visibleBrands.size, 8); + // 3 个包 × 每个包一个支持行业 × 2 个版本 = 6 个隔离模拟品牌。 + assert.equal(visibleBrands.size, 6); } finally { for (const fixture of fixtures) rmSync(fixture.root, { recursive: true, force: true }); } diff --git a/apps/api/test/template-version-order.test.ts b/apps/api/test/template-version-order.test.ts new file mode 100644 index 0000000..b966e1c --- /dev/null +++ b/apps/api/test/template-version-order.test.ts @@ -0,0 +1,33 @@ +import assert from "node:assert/strict"; +import { test } from "node:test"; +import { compareTemplateVersions, latestTemplateVersion } from "../src/template-version-order.js"; + +test("模板版本按 SemVer 而不是导入时间判断最新版", () => { + const importedLaterOldVersion = { + version: "1.9.0", + importedAt: new Date("2026-10-20T00:00:00Z"), + }; + const importedEarlierNewVersion = { + version: "1.10.0", + importedAt: new Date("2026-10-19T00:00:00Z"), + }; + assert.equal( + latestTemplateVersion([importedEarlierNewVersion, importedLaterOldVersion])?.version, + "1.10.0", + ); + assert.ok(compareTemplateVersions("1.10.0", "1.9.0") > 0); +}); + +test("模板版本排序正确处理预发布版本和同版本稳定性", () => { + assert.ok(compareTemplateVersions("1.0.0", "1.0.0-beta.2") > 0); + assert.ok(compareTemplateVersions("1.0.0-beta.10", "1.0.0-beta.2") > 0); + const first = { + version: "1.0.0", + importedAt: new Date("2026-10-19T00:00:00Z"), + }; + const second = { + version: "1.0.0", + importedAt: new Date("2026-10-20T00:00:00Z"), + }; + assert.equal(latestTemplateVersion([first, second]), second); +}); diff --git a/apps/taro/test/browser/admin-editor.spec.ts b/apps/taro/test/browser/admin-editor.spec.ts index dabb42f..1b1172b 100644 --- a/apps/taro/test/browser/admin-editor.spec.ts +++ b/apps/taro/test/browser/admin-editor.spec.ts @@ -657,13 +657,13 @@ test("林境模板支持首页和主理人区域点选", async ({ page }) => { await page.setViewportSize({ width: 1600, height: 900 }); const editorialBrand = { ...structuredClone(brand), - templateKey: "personal", - avatarUrl: "/assets/acheng-campus-food/owner/portrait.jpg", + templateKey: "doors", + avatarUrl: "/template-preview/assets/linjing-editorial/content/founder-portrait.jpg", config: { visualTemplateKey: "linjing-editorial", founder: "林境主理人", - title: "建筑设计师", - heroImage: "/assets/acheng-campus-food/owner/portrait.jpg", + title: "门系统设计师", + heroImage: "/template-preview/assets/linjing-editorial/content/entry-door.jpg", homeHero: { title: "林境作品" }, visualPresentation: { home: { @@ -697,13 +697,13 @@ test("林境模板支持首页和主理人区域点选", async ({ page }) => { ...editorialBrand, ...editorialBrand.config, founder: "林境主理人", - title: "建筑设计师", - heroImage: "/assets/acheng-campus-food/owner/portrait.jpg", + title: "门系统设计师", + heroImage: "/template-preview/assets/linjing-editorial/content/entry-door.jpg", homeHero: { title: "林境作品" }, }, offerings: structuredClone(runtimeWorkspace.offerings).map((item) => ({ ...item, - coverUrl: "/assets/acheng-campus-food/owner/portrait.jpg", + coverUrl: "/template-preview/assets/linjing-editorial/content/entry-door.jpg", })), trustItems: [ { @@ -800,9 +800,9 @@ test("林境模板支持首页和主理人区域点选", async ({ page }) => { } if (path === "/admin/config/trust-content") return route.fulfill({ json: editorialWorkspace.trustItems }); - if (path === "/public/templates/personal") + if (path === "/public/templates/doors") return route.fulfill({ - json: { name: "个人品牌", description: "林境模板", serviceCategories: [] }, + json: { name: "门窗业务", description: "林境页面方案", serviceCategories: [] }, }); if (path === "/admin/workspace") return route.fulfill({ diff --git a/apps/taro/test/browser/template-preview-media.spec.ts b/apps/taro/test/browser/template-preview-media.spec.ts index 27e53a9..1ba4e40 100644 --- a/apps/taro/test/browser/template-preview-media.spec.ts +++ b/apps/taro/test/browser/template-preview-media.spec.ts @@ -52,7 +52,6 @@ type MediaCase = { const mediaCases: MediaCase[] = [ { packageKey: "acheng-campus-food", industry: "food", founder: "阿成" }, { packageKey: "atelier-solopreneur", industry: "personal", founder: "林予 · 示例主理人" }, - { packageKey: "linjing-editorial", industry: "personal", founder: "示例主理人" }, { packageKey: "linjing-editorial", industry: "doors", founder: "林叙安 (Lin XUAN)" }, ]; diff --git a/config/template-build.json b/config/template-build.json index 4d213aa..dd20af0 100644 --- a/config/template-build.json +++ b/config/template-build.json @@ -9,7 +9,7 @@ { "packageKey": "linjing-editorial", "packageName": "@personal-brand/template-linjing-editorial", - "version": "1.0.6" + "version": "1.0.7" }, { "packageKey": "atelier-solopreneur", diff --git a/docs/adr/0009-visual-template-compatibility.md b/docs/adr/0009-visual-template-compatibility.md index 0ea5c06..3b5a8b5 100644 --- a/docs/adr/0009-visual-template-compatibility.md +++ b/docs/adr/0009-visual-template-compatibility.md @@ -6,7 +6,7 @@ ## Decision -在视觉模板 definition 与 manifest 中增加 `supportedIndustryTemplates`。目录、组合预览和实际切换均通过共享 `isVisualTemplateCompatible` 校验。当前林境模板支持 `personal`、`doors`;极简模板支持 `personal`、`food`、`doors`。 +在视觉模板 definition 与 manifest 中增加 `supportedIndustryTemplates`。目录、组合预览和实际切换均通过共享 `isVisualTemplateCompatible` 校验。当前林境模板只支持 `doors`;极简模板支持 `personal`、`food`、`doors`。 ## Alternatives diff --git a/docs/adr/0026-brand-single-industry-template.md b/docs/adr/0026-brand-single-industry-template.md index 8da56f9..086743d 100644 --- a/docs/adr/0026-brand-single-industry-template.md +++ b/docs/adr/0026-brand-single-industry-template.md @@ -21,7 +21,8 @@ ### 2. 后台页面按「日常经营」与「模板治理」拆开 - `咨询表单与字段`(`/admin/workspace`)只负责咨询入口表单与高级自定义字段,归入「日常经营」,不再承载任何模板、视觉或组合预览。 -- 模板治理归入「配置与发布 → 内容发布」的「选择表达方式」:行业模板只读展示、视觉模板选择、模板版本升级与回滚。视觉模板是行业模板的排版变体,不是新的行业身份。 +- 页面方案治理归入独立的「页面方案」页面:业务类型只读展示,页面方案版本可升级、切换和恢复。页面方案是业务类型的排版变体,不是新的行业身份。 +- 「内容与发布」只处理内容检查、发布、撤回、小程序发布和配置,不再承载业务类型或页面方案选择。 ## 替代方案 @@ -33,8 +34,8 @@ - 品牌身份、模板台账、发布快照三者不会再互相漂移;公开运行时始终跑品牌当前的行业模板。 - 行业模板不可在后台切换,切换到另一行业需要显式的产品与迁移方案。 -- 视觉模板切换历史/回滚、模板组合预览从 UI 中移除。当前每个行业实际只适配一个视觉模板,这两块属于不可达的死 UI。 -- 后台的模板治理不再是 owner 专属的高深设置,而是和发布放在同一处。 +- 本 ADR 采纳时移除了视觉模板切换历史/回滚和组合预览;后续由 [ADR 0033](0033-brand-business-type-and-page-scheme-separation.md) 将页面方案版本升级、切换和恢复迁入独立「页面方案」页面。 +- 后台的模板治理不再由内容发布页承载;当前边界以 ADR 0033 为准。 ## 迁移计划 diff --git a/docs/adr/0033-brand-business-type-and-page-scheme-separation.md b/docs/adr/0033-brand-business-type-and-page-scheme-separation.md new file mode 100644 index 0000000..a17103c --- /dev/null +++ b/docs/adr/0033-brand-business-type-and-page-scheme-separation.md @@ -0,0 +1,54 @@ +# 0033 品牌业务类型与页面方案分离 + +- 状态:已采纳 +- 日期:2026-10-20 + +## Context + +品牌创建、页面方案选择和内容发布此前共用「行业模板」「视觉模板」「选择表达方式」等内部概念。运营者无法判断哪个选择决定字段与能力,哪个选择只影响页面结构和视觉,也容易把页面方案切换误解为业务类型切换。林境画册还同时出现在 `personal` 与 `doors` 兼容矩阵中,导致个人品牌模板与门窗模板的身份边界失效。 + +## Decision + +1. **业务类型是品牌身份** + - 业务类型决定字段、能力、业务提供项 schema 和咨询表单语义。 + - 业务类型在创建品牌时确定,创建后不可修改。 + - 创建品牌必须显式选择业务类型和一个与它兼容的已发布页面方案。 + +2. **页面方案是结构和视觉版本** + - 页面方案决定页面清单、模块结构、视觉资源槽位和版本。 + - 页面方案可以升级、切换到同一业务类型的其他已发布版本,并恢复上一版配置基线。 + - 页面方案切换不改变品牌业务类型,不删除品牌内容、业务提供项或咨询记录。 + +3. **创建流程不导入示例内容** + - 创建品牌只建立品牌身份、成员关系、字段定义和页面方案安装记录。 + - 示例内容只能由管理员在「页面方案 → 高级」中显式预览并确认导入,且只补齐缺失内容。 + +4. **兼容矩阵由模板包声明** + - `linjing-editorial` 只支持 `doors`,不得在页面方案目录、创建品牌页、预览或 API 中把它与 `personal` 组合。 + - `personal` 只展示 `atelier-solopreneur`;`food` 只展示 `acheng-campus-food`。 + +5. **内部模板键不对运营用户暴露** + - Admin 页面不展示 `packageKey`、`visualTemplateKey`、`renderer` 等内部名称。 + - 页面使用「业务类型」「页面方案」「版本」等用户语义;API 仍以稳定 key 作为边界校验值。 + +## Alternatives + +- 继续用一个「表达方式」控件同时选择业务类型和页面方案:运营者无法理解不可变与可升级的差异,拒绝。 +- 允许创建后修改业务类型:会造成字段、内容、能力与发布快照漂移,需要跨行业迁移方案,当前不支持。 +- 创建品牌时自动导入示例内容:会把演示文案误认为真实品牌资料,并让空品牌与演示品牌无法区分,拒绝。 +- 继续让林境兼容 `personal`:与专属个人品牌模板职责重叠,且林境页面和 sample 内容面向门窗业务,拒绝。 + +## Consequences + +- 创建品牌多了一步「选择页面方案」,但业务类型的不可变边界变得明确。 +- 页面方案升级与业务类型稳定解耦,发布流程不再承载模板治理。 +- 林境不再出现在 `personal` 组合中;旧的不兼容数据必须通过显式迁移或人工修复,不做运行时兜底。 +- 页面方案的版本切换和配置恢复需要保持幂等、授权校验和内容冲突提示。 + +## Migration + +- 新增 owner-only 的 `GET /admin/brands/creation-options` 与 `POST /admin/brands`,创建时校验业务类型、页面方案兼容性和版本发布状态。 +- 新增 `GET /admin/workspace/template/options`,供 owner/admin/platform-admin 读取当前品牌的业务类型和兼容页面方案。 +- Admin 新增「创建品牌」与「页面方案」页面;「内容与发布」移除业务类型和页面方案选择。 +- `linjing-editorial` 升至 `1.0.7`,兼容矩阵收窄为仅 `doors`;同步更新 package、manifest、registry 和测试 fixture。 +- 已有品牌保留当前业务类型和页面方案版本;不兼容组合不做静默改写,升级或迁移必须显式执行。 diff --git a/docs/template-management-delivery-plan.md b/docs/template-management-delivery-plan.md index 778f9ee..93e5ea8 100644 --- a/docs/template-management-delivery-plan.md +++ b/docs/template-management-delivery-plan.md @@ -444,7 +444,7 @@ Phase 3 现场验收纠偏(2026-10-16): - atelier 独立 fixture 也没有头像。已升为 `atelier-solopreneur@1.3.0`,在 `previewFixture.personal.brand` 中加入包内头像,继续保持预览数据与 bootstrap sample 分离。 - 修复 Admin 导入包预览中 food renderer 的资源 key 前缀映射:包内 `/assets/service/*.png` 等图标现在可从 archive 校验后的 data URL 渲染,不回退到本地部署资源。 - 矩阵 API 回归新增断言:每个支持行业的主理人身份非空、头像指向包内资源、所有 asset slot 都是 `ready`、没有诊断。 -- 新增 Playwright 媒体矩阵:覆盖 `acheng/food`、`atelier/personal`、`linjing/personal`、`linjing/doors`,使用真实 `template:pack` 产物和 API preview service;验证失败重试、founder 可见、所有 `data:` 图像 `naturalWidth > 0`、无“内容缺失”、无真实写入请求。四张截图已人工检查。 +- 新增 Playwright 媒体矩阵:覆盖 `acheng/food`、`atelier/personal`、`linjing/doors`,使用真实 `template:pack` 产物和 API preview service;验证失败重试、founder 可见、所有 `data:` 图像 `naturalWidth > 0`、无“内容缺失”、无真实写入请求。四张截图已人工检查。 - 本轮本地目录以最新已发布版本为准:`acheng-campus-food@1.0.1`、`atelier-solopreneur@1.3.0`、`linjing-editorial@1.0.3`;被取代的旧演示版本进入 retired。 Phase 3 隔离、导航和矩阵收口(2026-10-16): @@ -452,7 +452,7 @@ Phase 3 隔离、导航和矩阵收口(2026-10-16): - Admin dev/preview 响应增加 CSP、`Referrer-Policy: no-referrer` 和 `X-Content-Type-Options: nosniff`。preview/生产 CSP 为 `default-src 'self'`、`script-src 'self'`、`object-src 'none'`、`base-uri 'none'`、`frame-ancestors 'self'`、`form-action 'self'`;图片和媒体允许 `self/data/blob` 以读取通过 checksum 校验的包内资源,样式保留 `unsafe-inline` 以支持现有 React UI。生产构建同时保留 CSP meta 作为静态托管防线。 - Vite dev 为 React refresh preamble 单独允许 inline script;这是开发服务器例外,不是 preview/生产契约。Playwright 校验响应中存在 CSP 的 `default-src 'self'`、包内资源所需的 `img-src data:` 和 `frame-ancestors 'self'`。 - Admin 画布监听 Taro web preview runtime 发出的导航事件,把 renderer 内真实 CTA 转成画布内切换;`detail` 路由同步选择对应 offering。Playwright 覆盖“首页案例 -> 详情 CTA -> 禁止提交的咨询表单”。 -- 新增真实包矩阵回归:`acheng-campus-food/food`、`atelier-solopreneur/personal`、`linjing-editorial/{personal,doors}`,每个组合各 2 个版本,共 8 个模拟品牌。测试校验行业兼容、Runtime/renderer 声明、模拟品牌 ID、包内资源逐项 checksum、禁用提交和跨版本隔离。 +- 新增真实包矩阵回归:`acheng-campus-food/food`、`atelier-solopreneur/personal`、`linjing-editorial/doors`,每个组合各 2 个版本,共 6 个模拟品牌。测试校验行业兼容、Runtime/renderer 声明、模拟品牌 ID、包内资源逐项 checksum、禁用提交和跨版本隔离。 - 矩阵回归发现 linjing doors 起始内容声明了未注册 capability `doors`。已将其修正为 `inquiry`,模板包升为 `linjing-editorial@1.0.1`,生成目录、release build 配置和模板注册表同步更新;旧 `1.0.0` 不在本轮改写。 - Playwright 支持通过 `TEMPLATE_PREVIEW_VISUAL_EVIDENCE` 输出 `home/detail/inquiry/profile` 截图。本轮已生成并人工检查:独立 fixture 身份、包内图片、详情 CTA、咨询禁用和我的页面正常。该证据覆盖本地 Admin/H5 预览,不替代微信真机视觉验收或审核上传。 - 本轮回归:API HTTP integration `52/52`、upload `2/2`、API unit `52/52`、Client `6/6`、Admin unit `6/6`、Playwright `1/1`;全仓 typecheck、变更范围 ESLint、format、Admin production build 和 `template:check` 通过。全仓 `pnpm lint` 仍有先前记录的 Admin 既有 error,非本轮阻塞。 diff --git a/docs/template-registry.md b/docs/template-registry.md index 824d8f9..8215684 100644 --- a/docs/template-registry.md +++ b/docs/template-registry.md @@ -15,7 +15,7 @@ ### 仓库内视觉模板包 - acheng-campus-food@1.0.3:餐饮场景,使用 food 行业能力。 -- linjing-editorial@1.0.4:林境建筑画册,可用于 doors 和 personal 组合。 +- linjing-editorial@1.0.7:林境建筑画册,仅适配 doors 业务类型。 - atelier-solopreneur@1.3.2:独立工坊方向,适配 personal 行业。 以上是仓库盘点,不表示三个包都已经通过线上导入、预览、品牌安装和微信上传验收。生成目录当前位于 packages/config/src/generated-template-packages.ts,后续必须由导出和 conformance 流程生成并校验。 diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts index 0f57aee..ef19707 100644 --- a/packages/api-client/src/index.ts +++ b/packages/api-client/src/index.ts @@ -11,10 +11,15 @@ export type { export type { AdminBrandMember, AdminBrandMembership, + BrandCreationOptions, + BrandCreationOptionBusiness, + BrandCreationOptionPageScheme, + BrandPageSchemeOptions, BrandPresentationUpdate, BrandProfile, BrandReleaseSummary, BrandUpdate, + CreateBrandInput, } from "./types/brand.js"; export type { MiniAppReleaseSettings, MiniAppReleaseTask } from "./types/brand.js"; export type { CapabilityInstallation } from "./types/capability.js"; @@ -192,6 +197,11 @@ export class ApiClient this.resources.brand.getAdminBrand(...arguments_); listAdminBrands = (...arguments_: Parameters) => this.resources.brand.listAdminBrands(...arguments_); + getAdminBrandCreationOptions = ( + ...arguments_: Parameters + ) => this.resources.brand.getAdminBrandCreationOptions(...arguments_); + createAdminBrand = (...arguments_: Parameters) => + this.resources.brand.createAdminBrand(...arguments_); switchAdminBrand = (...arguments_: Parameters) => this.resources.brand.switchAdminBrand(...arguments_); listAdminMembers = (...arguments_: Parameters) => @@ -291,6 +301,9 @@ export class ApiClient getAdminTemplateOperationFailures = ( ...arguments_: Parameters ) => this.resources.template.getAdminTemplateOperationFailures(...arguments_); + getAdminPageSchemeOptions = ( + ...arguments_: Parameters + ) => this.resources.template.getAdminPageSchemeOptions(...arguments_); getPublicOffering = (...arguments_: Parameters) => this.resources.offering.getPublicOffering(...arguments_); listPublicOfferings = (...arguments_: Parameters) => diff --git a/packages/api-client/src/resources/brand.ts b/packages/api-client/src/resources/brand.ts index 6f90c19..935610d 100644 --- a/packages/api-client/src/resources/brand.ts +++ b/packages/api-client/src/resources/brand.ts @@ -2,9 +2,11 @@ import type { RequestFn } from "../client/request.js"; import type { AdminBrandMember, AdminBrandMembership, + BrandCreationOptions, BrandPresentationUpdate, BrandProfile, BrandReleaseSummary, + CreateBrandInput, MiniAppReleaseTask, MiniAppReleaseSettings, BrandUpdate, @@ -13,6 +15,11 @@ import type { export interface BrandMethods { getAdminBrand(): Promise; listAdminBrands(): Promise; + getAdminBrandCreationOptions(): Promise; + createAdminBrand(body: CreateBrandInput): Promise<{ + role: string; + brand: AdminBrandMembership["brand"]; + }>; switchAdminBrand( brandId: string, ): Promise<{ role: string; brand: AdminBrandMembership["brand"] }>; @@ -74,6 +81,8 @@ export function brandMethods({ request }: { request: RequestFn }): BrandMethods return { getAdminBrand: () => request("/admin/config/brand"), listAdminBrands: () => request("/admin/brands"), + getAdminBrandCreationOptions: () => request("/admin/brands/creation-options"), + createAdminBrand: (body) => request("/admin/brands", { method: "POST", body }), switchAdminBrand: (brandId) => request(`/admin/brands/${encodeURIComponent(brandId)}/switch`, { method: "POST" }), listAdminMembers: () => request("/admin/brands/members"), diff --git a/packages/api-client/src/resources/template.ts b/packages/api-client/src/resources/template.ts index ad7e120..256c37c 100644 --- a/packages/api-client/src/resources/template.ts +++ b/packages/api-client/src/resources/template.ts @@ -1,6 +1,6 @@ import type { BrandTemplateKey, RuntimeWorkspace } from "@personal-brand/types"; import type { RequestFn } from "../client/request.js"; -import type { BrandProfile } from "../types/brand.js"; +import type { BrandPageSchemeOptions, BrandProfile } from "../types/brand.js"; import type { CapabilityWithMetadata } from "../types/capability.js"; import type { BrandFieldDefinition } from "../types/field.js"; import type { Offering } from "../types/offering.js"; @@ -8,6 +8,7 @@ import type { AdminTemplateContent } from "../types/template.js"; import type { BrandTemplateDefinition } from "../types/template-definition.js"; export interface TemplateMethods { + getAdminPageSchemeOptions(): Promise; listAdminTemplatePackages(params?: { page?: number; pageSize?: number; @@ -310,6 +311,7 @@ export interface TemplatePackageImportResult { export function templateMethods({ request }: { request: RequestFn }): TemplateMethods { return { + getAdminPageSchemeOptions: () => request("/admin/workspace/template/options"), listAdminTemplatePackages: (params = {}) => { const query = [ params.page === undefined ? null : `page=${encodeURIComponent(String(params.page))}`, diff --git a/packages/api-client/src/types/brand.ts b/packages/api-client/src/types/brand.ts index b7b3e70..eefc5b8 100644 --- a/packages/api-client/src/types/brand.ts +++ b/packages/api-client/src/types/brand.ts @@ -2,7 +2,7 @@ import type { BrandTemplateKey } from "@personal-brand/types"; export interface BrandProfile { id: string; - slug?: string; + slug: string; name: string; templateKey: BrandTemplateKey; tagline: string | null; @@ -20,7 +20,39 @@ export interface BrandProfile { export interface AdminBrandMembership { id: string; role: string; - brand: Pick & { slug?: string }; + brand: Pick; +} + +export interface BrandCreationOptionBusiness { + key: BrandTemplateKey; + name: string; + description: string; +} + +export interface BrandCreationOptionPageScheme { + templatePackageVersionId: string; + name: string; + description: string; + version: string; + supportedBusinessTypes: BrandTemplateKey[]; + isLatestForPackage: boolean; +} + +export interface BrandCreationOptions { + businesses: BrandCreationOptionBusiness[]; + pageSchemes: BrandCreationOptionPageScheme[]; +} + +export interface BrandPageSchemeOptions { + business: BrandCreationOptionBusiness; + pageSchemes: BrandCreationOptionPageScheme[]; +} + +export interface CreateBrandInput { + name: string; + slug: string; + businessType: BrandTemplateKey; + templatePackageVersionId: string; } export interface AdminBrandMember { diff --git a/packages/api-client/test/client.test.ts b/packages/api-client/test/client.test.ts index 151a14c..4b524dd 100644 --- a/packages/api-client/test/client.test.ts +++ b/packages/api-client/test/client.test.ts @@ -101,6 +101,40 @@ test("品牌切换客户端不再接收 token", async () => { ]); }); +test("创建品牌与品牌内页面方案选项使用各自授权接口", async () => { + const calls: Array<{ url: string; method?: string; body?: string }> = []; + const client = new ApiClient({ + baseUrl: "http://api.test", + token: "owner-token", + fetcher: async (url, init) => { + calls.push({ url, method: init?.method, body: init?.body }); + return response({}); + }, + }); + await client.getAdminBrandCreationOptions(); + await client.createAdminBrand({ + name: "林境门窗", + slug: "linjing-windows", + businessType: "doors", + templatePackageVersionId: "version-1", + }); + await client.getAdminPageSchemeOptions(); + assert.deepEqual(calls, [ + { url: "http://api.test/admin/brands/creation-options", method: "GET", body: undefined }, + { + url: "http://api.test/admin/brands", + method: "POST", + body: JSON.stringify({ + name: "林境门窗", + slug: "linjing-windows", + businessType: "doors", + templatePackageVersionId: "version-1", + }), + }, + { url: "http://api.test/admin/workspace/template/options", method: "GET", body: undefined }, + ]); +}); + test("客户端将统一错误响应转换为 ApiClientError", async () => { const client = new ApiClient({ baseUrl: "http://api.test", @@ -206,7 +240,7 @@ test("模板目录客户端发送分页并支持版本发布和审计", async () ]); }); -test("模板升级和回滚提交预览版本、checksum 与逐项保留确认", async () => { +test("模板升级和回滚提交预览版本、checksum 与全部保留确认", async () => { const calls: Array<{ url: string; method?: string; body?: string }> = []; const client = new ApiClient({ baseUrl: "http://api.test", diff --git a/packages/config/src/generated-template-packages.ts b/packages/config/src/generated-template-packages.ts index 1203554..4525a97 100644 --- a/packages/config/src/generated-template-packages.ts +++ b/packages/config/src/generated-template-packages.ts @@ -4417,12 +4417,11 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, { "packageKey": "linjing-editorial", - "version": "1.0.6", + "version": "1.0.7", "displayName": "林境建筑画册", "defaultBrandSlug": "linjing-doors", "runtimeContract": "1.0", "supportedIndustryTemplates": [ - "personal", "doors" ], "entrypoints": { @@ -5765,7 +5764,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "序章·入户门", "summary": "为别墅入口定制的整樘门系统", "categoryKey": "entrance-door", - "coverUrl": "/assets/content/doors-hero.jpg", + "coverUrl": "/assets/content/entry-door.jpg", "priceText": "按项目确认", "config": { "series": "「万籁」重型天地轴入户系统", @@ -5784,7 +5783,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-hero.jpg", + "url": "/assets/content/entry-door.jpg", "alt": "", "type": "image" } @@ -5796,7 +5795,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "庭院·边界门", "summary": "连接建筑与庭院的定制门", "categoryKey": "garden-door", - "coverUrl": "/assets/content/doors-yard-gate.jpg", + "coverUrl": "/assets/content/courtyard-gate.jpg", "priceText": "按项目确认", "config": { "series": "「虚实」透光私家庭院门", @@ -5815,7 +5814,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-yard-gate.jpg", + "url": "/assets/content/courtyard-gate.jpg", "alt": "", "type": "image" } @@ -5827,7 +5826,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "室内·静谧门", "summary": "统一室内空间秩序的户内门", "categoryKey": "interior-door", - "coverUrl": "/assets/content/doors-room-door.jpg", + "coverUrl": "/assets/content/interior-door.jpg", "priceText": "按项目确认", "config": { "series": "「空灵」2.8m - 3.2m 满高通顶系统", @@ -5846,7 +5845,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-room-door.jpg", + "url": "/assets/content/interior-door.jpg", "alt": "", "type": "image" } @@ -5858,7 +5857,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "一对一门系统设计咨询", "summary": "从现场到方案的完整设计沟通", "categoryKey": "custom", - "coverUrl": "/assets/content/personal-consulting.jpg", + "coverUrl": "/assets/content/design-consultation.jpg", "priceText": "按项目确认", "config": { "series": "「无垠」密室及背景墙融合门", @@ -5877,7 +5876,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/personal-consulting.jpg", + "url": "/assets/content/design-consultation.jpg", "alt": "", "type": "image" } @@ -6100,8 +6099,8 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "phone": "186-0218-9908", "wechat": "LIN-ATELIER-2024", "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/doors-hero.jpg", + "avatarUrl": "/assets/content/founder-portrait.jpg", + "heroImage": "/assets/content/entry-door.jpg", "visualPresentation": { "home": { "founderBadge": "接受项目沟通", @@ -6181,151 +6180,6 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ ] } } - }, - "personal": { - "templateKey": "personal", - "inquiryFormName": "合作咨询表单", - "offerings": [ - { - "kind": "service", - "name": "示例·品牌定位咨询", - "summary": "梳理品牌定位与下一步行动。", - "categoryKey": "consulting", - "coverUrl": "/assets/content/personal-consulting.jpg", - "priceText": "按需求确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-consulting.jpg", - "alt": "", - "type": "image" - } - ] - } - }, - { - "kind": "service", - "name": "示例·长期顾问支持", - "summary": "围绕表达和转化提供持续支持。", - "categoryKey": "advisory", - "coverUrl": "/assets/content/personal-advisory.jpg", - "priceText": "按服务周期确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-advisory.jpg", - "alt": "", - "type": "image" - } - ] - } - } - ], - "trustContent": [ - { - "type": "credential", - "title": "关于主理人", - "content": "示例内容,待品牌主理人完善。" - }, - { - "type": "process", - "title": "合作方法", - "content": "示例内容,待品牌主理人完善。" - } - ], - "fields": [ - { - "key": "name", - "label": "您的称呼", - "type": "text", - "required": true - }, - { - "key": "phone", - "label": "联系方式", - "type": "phone", - "required": true - }, - { - "key": "remark", - "label": "合作需求", - "type": "textarea", - "required": true - } - ], - "capabilityKey": "inquiry", - "brandConfig": { - "templateData": { - "designPhilosophy": "先厘清问题,再设计表达" - }, - "title": "品牌策略顾问", - "slogan": "用清晰的定位与可执行的表达,让专业被看见。", - "phone": "", - "wechat": "", - "studioAddress": "上海市徐汇区创意园区", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/personal-consulting.jpg", - "visualPresentation": { - "home": { - "founderBadge": "接受项目沟通", - "proofEyebrow": "专业经验与合作成果", - "proofTitle": "经验与方法", - "manifestoEyebrow": "工作原则", - "manifestoTitle": "先厘清问题,再设计表达", - "worksEyebrow": "合作方式", - "worksTitle": "品牌策略与顾问服务", - "worksAction": "查看全部 →" - }, - "offerings": { - "title": "合作方式", - "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", - "materialLabel": "包含:", - "hardwareLabel": "定制说明:", - "detailAction": "查看详情 →", - "inquiryAction": "发起咨询" - }, - "detail": { - "priceLabel": "价格参考", - "spaceLabel": "适合场景", - "backgroundTitle": "项目背景", - "conceptTitle": "设计思路", - "craftsTitle": "交付要点", - "materialsTitle": "材料与说明", - "inquiryAction": "发起咨询", - "inquiryHint": "提交信息后由主理人与您沟通。" - }, - "profile": { - "phoneLabel": "联系电话", - "wechatLabel": "微信", - "addressLabel": "工作地点", - "callAction": "呼叫", - "copyAction": "复制", - "recordsTitle": "我的咨询记录", - "recordsCountUnit": "条记录" - }, - "inquiry": { - "eyebrow": "COLLABORATION", - "title": "合作咨询", - "subtitle": "留下你的需求与目标,主理人会尽快联系。", - "submitLabel": "提交咨询" - }, - "success": { - "eyebrow": "COLLABORATION", - "title": "已收到你的咨询", - "intro": "主理人会尽快与你联系。", - "recordsAction": "查看咨询记录", - "homeAction": "返回首页" - }, - "records": { - "title": "我的咨询记录", - "createAction": "新增咨询", - "emptyTitle": "还没有咨询记录", - "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", - "emptyAction": "开始咨询" - } - }, - "founder": "示例主理人" - } } }, "pages": [ @@ -6335,7 +6189,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ ], "visualTemplateKey": "linjing-editorial", "visualPresentation": { - "description": "适合高端定制、建筑作品和项目型个人品牌。", + "description": "适合高端定制的门窗、建筑入口和私宅项目。", "variants": { "hero": "architectural", "offeringList": "editorial", @@ -6389,7 +6243,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "序章·入户门", "summary": "为别墅入口定制的整樘门系统", "categoryKey": "entrance-door", - "coverUrl": "/assets/content/doors-hero.jpg", + "coverUrl": "/assets/content/entry-door.jpg", "priceText": "按项目确认", "config": { "series": "「万籁」重型天地轴入户系统", @@ -6408,7 +6262,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-hero.jpg", + "url": "/assets/content/entry-door.jpg", "alt": "", "type": "image" } @@ -6420,7 +6274,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "庭院·边界门", "summary": "连接建筑与庭院的定制门", "categoryKey": "garden-door", - "coverUrl": "/assets/content/doors-yard-gate.jpg", + "coverUrl": "/assets/content/courtyard-gate.jpg", "priceText": "按项目确认", "config": { "series": "「虚实」透光私家庭院门", @@ -6439,7 +6293,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-yard-gate.jpg", + "url": "/assets/content/courtyard-gate.jpg", "alt": "", "type": "image" } @@ -6451,7 +6305,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "室内·静谧门", "summary": "统一室内空间秩序的户内门", "categoryKey": "interior-door", - "coverUrl": "/assets/content/doors-room-door.jpg", + "coverUrl": "/assets/content/interior-door.jpg", "priceText": "按项目确认", "config": { "series": "「空灵」2.8m - 3.2m 满高通顶系统", @@ -6470,7 +6324,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/doors-room-door.jpg", + "url": "/assets/content/interior-door.jpg", "alt": "", "type": "image" } @@ -6482,7 +6336,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "name": "一对一门系统设计咨询", "summary": "从现场到方案的完整设计沟通", "categoryKey": "custom", - "coverUrl": "/assets/content/personal-consulting.jpg", + "coverUrl": "/assets/content/design-consultation.jpg", "priceText": "按项目确认", "config": { "series": "「无垠」密室及背景墙融合门", @@ -6501,7 +6355,7 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ }, "media": [ { - "url": "/assets/content/personal-consulting.jpg", + "url": "/assets/content/design-consultation.jpg", "alt": "", "type": "image" } @@ -6724,8 +6578,8 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "phone": "186-0218-9908", "wechat": "LIN-ATELIER-2024", "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/doors-hero.jpg", + "avatarUrl": "/assets/content/founder-portrait.jpg", + "heroImage": "/assets/content/entry-door.jpg", "visualPresentation": { "home": { "founderBadge": "接受项目沟通", @@ -6811,168 +6665,9 @@ export const generatedTemplatePackageRegistry: readonly TemplatePackageManifest[ "customerRecords": "disabled", "contactActions": "disabled" } - }, - "personal": { - "schemaVersion": "1", - "brand": { - "name": "林境建筑画册 · 预览", - "tagline": "用于独立预览的模板演示内容", - "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", - "deliveryNote": "演示预览已禁用真实咨询和联系操作。" - }, - "content": { - "templateKey": "personal", - "inquiryFormName": "合作咨询表单", - "offerings": [ - { - "kind": "service", - "name": "示例·品牌定位咨询", - "summary": "梳理品牌定位与下一步行动。", - "categoryKey": "consulting", - "coverUrl": "/assets/content/personal-consulting.jpg", - "priceText": "按需求确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-consulting.jpg", - "alt": "", - "type": "image" - } - ] - } - }, - { - "kind": "service", - "name": "示例·长期顾问支持", - "summary": "围绕表达和转化提供持续支持。", - "categoryKey": "advisory", - "coverUrl": "/assets/content/personal-advisory.jpg", - "priceText": "按服务周期确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-advisory.jpg", - "alt": "", - "type": "image" - } - ] - } - } - ], - "trustContent": [ - { - "type": "credential", - "title": "关于主理人", - "content": "示例内容,待品牌主理人完善。" - }, - { - "type": "process", - "title": "合作方法", - "content": "示例内容,待品牌主理人完善。" - } - ], - "fields": [ - { - "key": "name", - "label": "您的称呼", - "type": "text", - "required": true - }, - { - "key": "phone", - "label": "联系方式", - "type": "phone", - "required": true - }, - { - "key": "remark", - "label": "合作需求", - "type": "textarea", - "required": true - } - ], - "capabilityKey": "inquiry", - "brandConfig": { - "templateData": { - "designPhilosophy": "先厘清问题,再设计表达" - }, - "title": "品牌策略顾问", - "slogan": "用清晰的定位与可执行的表达,让专业被看见。", - "phone": "", - "wechat": "", - "studioAddress": "上海市徐汇区创意园区", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/personal-consulting.jpg", - "visualPresentation": { - "home": { - "founderBadge": "接受项目沟通", - "proofEyebrow": "专业经验与合作成果", - "proofTitle": "经验与方法", - "manifestoEyebrow": "工作原则", - "manifestoTitle": "先厘清问题,再设计表达", - "worksEyebrow": "合作方式", - "worksTitle": "品牌策略与顾问服务", - "worksAction": "查看全部 →" - }, - "offerings": { - "title": "合作方式", - "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", - "materialLabel": "包含:", - "hardwareLabel": "定制说明:", - "detailAction": "查看详情 →", - "inquiryAction": "发起咨询" - }, - "detail": { - "priceLabel": "价格参考", - "spaceLabel": "适合场景", - "backgroundTitle": "项目背景", - "conceptTitle": "设计思路", - "craftsTitle": "交付要点", - "materialsTitle": "材料与说明", - "inquiryAction": "发起咨询", - "inquiryHint": "提交信息后由主理人与您沟通。" - }, - "profile": { - "phoneLabel": "联系电话", - "wechatLabel": "微信", - "addressLabel": "工作地点", - "callAction": "呼叫", - "copyAction": "复制", - "recordsTitle": "我的咨询记录", - "recordsCountUnit": "条记录" - }, - "inquiry": { - "eyebrow": "COLLABORATION", - "title": "合作咨询", - "subtitle": "留下你的需求与目标,主理人会尽快联系。", - "submitLabel": "提交咨询" - }, - "success": { - "eyebrow": "COLLABORATION", - "title": "已收到你的咨询", - "intro": "主理人会尽快与你联系。", - "recordsAction": "查看咨询记录", - "homeAction": "返回首页" - }, - "records": { - "title": "我的咨询记录", - "createAction": "新增咨询", - "emptyTitle": "还没有咨询记录", - "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", - "emptyAction": "开始咨询" - } - }, - "founder": "示例主理人" - } - }, - "safety": { - "submissions": "disabled", - "customerRecords": "disabled", - "contactActions": "disabled" - } } } } ]; export const generatedTemplatePackageRegistryHash = - "6c629f916b92e889a8984fde3ffc8ea3cb39ba25542b070da1f029ae57665d73"; + "06182e0005339404614b39e2051180d15bc6aa83f572194a7f4b7403650d3e8d"; diff --git a/packages/template-linjing-editorial/README.md b/packages/template-linjing-editorial/README.md index 91e78d9..aaee6c5 100644 --- a/packages/template-linjing-editorial/README.md +++ b/packages/template-linjing-editorial/README.md @@ -1,3 +1,3 @@ # 林境建筑画册模板包 -林境是个人品牌和项目型业务的编辑式视觉模板。页面只消费公共 Runtime Workspace。 +林境是面向门窗与建筑入口项目的编辑式视觉模板,只适配 `doors` 业务类型。页面只消费公共 Runtime Workspace。 diff --git a/packages/template-linjing-editorial/miniapp/assets/content/courtyard-gate.jpg b/packages/template-linjing-editorial/miniapp/assets/content/courtyard-gate.jpg new file mode 100644 index 0000000..dec7014 Binary files /dev/null and b/packages/template-linjing-editorial/miniapp/assets/content/courtyard-gate.jpg differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/design-consultation.jpg b/packages/template-linjing-editorial/miniapp/assets/content/design-consultation.jpg new file mode 100644 index 0000000..f9960ee Binary files /dev/null and b/packages/template-linjing-editorial/miniapp/assets/content/design-consultation.jpg differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/doors-room-door.jpg b/packages/template-linjing-editorial/miniapp/assets/content/doors-room-door.jpg deleted file mode 100644 index f62d228..0000000 Binary files a/packages/template-linjing-editorial/miniapp/assets/content/doors-room-door.jpg and /dev/null differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/doors-yard-gate.jpg b/packages/template-linjing-editorial/miniapp/assets/content/doors-yard-gate.jpg deleted file mode 100644 index 973bcc1..0000000 Binary files a/packages/template-linjing-editorial/miniapp/assets/content/doors-yard-gate.jpg and /dev/null differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/doors-hero.jpg b/packages/template-linjing-editorial/miniapp/assets/content/entry-door.jpg similarity index 100% rename from packages/template-linjing-editorial/miniapp/assets/content/doors-hero.jpg rename to packages/template-linjing-editorial/miniapp/assets/content/entry-door.jpg diff --git a/packages/template-linjing-editorial/miniapp/assets/content/personal-avatar.jpg b/packages/template-linjing-editorial/miniapp/assets/content/founder-portrait.jpg similarity index 100% rename from packages/template-linjing-editorial/miniapp/assets/content/personal-avatar.jpg rename to packages/template-linjing-editorial/miniapp/assets/content/founder-portrait.jpg diff --git a/packages/template-linjing-editorial/miniapp/assets/content/interior-door.jpg b/packages/template-linjing-editorial/miniapp/assets/content/interior-door.jpg new file mode 100644 index 0000000..21a711c Binary files /dev/null and b/packages/template-linjing-editorial/miniapp/assets/content/interior-door.jpg differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/personal-advisory.jpg b/packages/template-linjing-editorial/miniapp/assets/content/personal-advisory.jpg deleted file mode 100644 index 3284c59..0000000 Binary files a/packages/template-linjing-editorial/miniapp/assets/content/personal-advisory.jpg and /dev/null differ diff --git a/packages/template-linjing-editorial/miniapp/assets/content/personal-consulting.jpg b/packages/template-linjing-editorial/miniapp/assets/content/personal-consulting.jpg deleted file mode 100644 index f140339..0000000 Binary files a/packages/template-linjing-editorial/miniapp/assets/content/personal-consulting.jpg and /dev/null differ diff --git a/packages/template-linjing-editorial/package.json b/packages/template-linjing-editorial/package.json index f744b56..636dd8a 100644 --- a/packages/template-linjing-editorial/package.json +++ b/packages/template-linjing-editorial/package.json @@ -1,6 +1,6 @@ { "name": "@personal-brand/template-linjing-editorial", - "version": "1.0.6", + "version": "1.0.7", "private": true, "type": "module", "files": [ diff --git a/packages/template-linjing-editorial/template.json b/packages/template-linjing-editorial/template.json index 36a3792..fd430ef 100644 --- a/packages/template-linjing-editorial/template.json +++ b/packages/template-linjing-editorial/template.json @@ -1,10 +1,10 @@ { "packageKey": "linjing-editorial", - "version": "1.0.6", + "version": "1.0.7", "displayName": "林境建筑画册", "defaultBrandSlug": "linjing-doors", "runtimeContract": "1.0", - "supportedIndustryTemplates": ["personal", "doors"], + "supportedIndustryTemplates": ["doors"], "entrypoints": { "home": "pages/index/index", "offerings": "pages/services/index", @@ -1329,7 +1329,7 @@ "name": "序章·入户门", "summary": "为别墅入口定制的整樘门系统", "categoryKey": "entrance-door", - "coverUrl": "/assets/content/doors-hero.jpg", + "coverUrl": "/assets/content/entry-door.jpg", "priceText": "按项目确认", "config": { "series": "「万籁」重型天地轴入户系统", @@ -1348,7 +1348,7 @@ }, "media": [ { - "url": "/assets/content/doors-hero.jpg", + "url": "/assets/content/entry-door.jpg", "alt": "", "type": "image" } @@ -1360,7 +1360,7 @@ "name": "庭院·边界门", "summary": "连接建筑与庭院的定制门", "categoryKey": "garden-door", - "coverUrl": "/assets/content/doors-yard-gate.jpg", + "coverUrl": "/assets/content/courtyard-gate.jpg", "priceText": "按项目确认", "config": { "series": "「虚实」透光私家庭院门", @@ -1379,7 +1379,7 @@ }, "media": [ { - "url": "/assets/content/doors-yard-gate.jpg", + "url": "/assets/content/courtyard-gate.jpg", "alt": "", "type": "image" } @@ -1391,7 +1391,7 @@ "name": "室内·静谧门", "summary": "统一室内空间秩序的户内门", "categoryKey": "interior-door", - "coverUrl": "/assets/content/doors-room-door.jpg", + "coverUrl": "/assets/content/interior-door.jpg", "priceText": "按项目确认", "config": { "series": "「空灵」2.8m - 3.2m 满高通顶系统", @@ -1410,7 +1410,7 @@ }, "media": [ { - "url": "/assets/content/doors-room-door.jpg", + "url": "/assets/content/interior-door.jpg", "alt": "", "type": "image" } @@ -1422,7 +1422,7 @@ "name": "一对一门系统设计咨询", "summary": "从现场到方案的完整设计沟通", "categoryKey": "custom", - "coverUrl": "/assets/content/personal-consulting.jpg", + "coverUrl": "/assets/content/design-consultation.jpg", "priceText": "按项目确认", "config": { "series": "「无垠」密室及背景墙融合门", @@ -1441,7 +1441,7 @@ }, "media": [ { - "url": "/assets/content/personal-consulting.jpg", + "url": "/assets/content/design-consultation.jpg", "alt": "", "type": "image" } @@ -1664,8 +1664,8 @@ "phone": "186-0218-9908", "wechat": "LIN-ATELIER-2024", "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/doors-hero.jpg", + "avatarUrl": "/assets/content/founder-portrait.jpg", + "heroImage": "/assets/content/entry-door.jpg", "visualPresentation": { "home": { "founderBadge": "接受项目沟通", @@ -1745,157 +1745,12 @@ ] } } - }, - "personal": { - "templateKey": "personal", - "inquiryFormName": "合作咨询表单", - "offerings": [ - { - "kind": "service", - "name": "示例·品牌定位咨询", - "summary": "梳理品牌定位与下一步行动。", - "categoryKey": "consulting", - "coverUrl": "/assets/content/personal-consulting.jpg", - "priceText": "按需求确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-consulting.jpg", - "alt": "", - "type": "image" - } - ] - } - }, - { - "kind": "service", - "name": "示例·长期顾问支持", - "summary": "围绕表达和转化提供持续支持。", - "categoryKey": "advisory", - "coverUrl": "/assets/content/personal-advisory.jpg", - "priceText": "按服务周期确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-advisory.jpg", - "alt": "", - "type": "image" - } - ] - } - } - ], - "trustContent": [ - { - "type": "credential", - "title": "关于主理人", - "content": "示例内容,待品牌主理人完善。" - }, - { - "type": "process", - "title": "合作方法", - "content": "示例内容,待品牌主理人完善。" - } - ], - "fields": [ - { - "key": "name", - "label": "您的称呼", - "type": "text", - "required": true - }, - { - "key": "phone", - "label": "联系方式", - "type": "phone", - "required": true - }, - { - "key": "remark", - "label": "合作需求", - "type": "textarea", - "required": true - } - ], - "capabilityKey": "inquiry", - "brandConfig": { - "templateData": { - "designPhilosophy": "先厘清问题,再设计表达" - }, - "title": "品牌策略顾问", - "slogan": "用清晰的定位与可执行的表达,让专业被看见。", - "phone": "", - "wechat": "", - "studioAddress": "上海市徐汇区创意园区", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/personal-consulting.jpg", - "visualPresentation": { - "home": { - "founderBadge": "接受项目沟通", - "proofEyebrow": "专业经验与合作成果", - "proofTitle": "经验与方法", - "manifestoEyebrow": "工作原则", - "manifestoTitle": "先厘清问题,再设计表达", - "worksEyebrow": "合作方式", - "worksTitle": "品牌策略与顾问服务", - "worksAction": "查看全部 →" - }, - "offerings": { - "title": "合作方式", - "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", - "materialLabel": "包含:", - "hardwareLabel": "定制说明:", - "detailAction": "查看详情 →", - "inquiryAction": "发起咨询" - }, - "detail": { - "priceLabel": "价格参考", - "spaceLabel": "适合场景", - "backgroundTitle": "项目背景", - "conceptTitle": "设计思路", - "craftsTitle": "交付要点", - "materialsTitle": "材料与说明", - "inquiryAction": "发起咨询", - "inquiryHint": "提交信息后由主理人与您沟通。" - }, - "profile": { - "phoneLabel": "联系电话", - "wechatLabel": "微信", - "addressLabel": "工作地点", - "callAction": "呼叫", - "copyAction": "复制", - "recordsTitle": "我的咨询记录", - "recordsCountUnit": "条记录" - }, - "inquiry": { - "eyebrow": "COLLABORATION", - "title": "合作咨询", - "subtitle": "留下你的需求与目标,主理人会尽快联系。", - "submitLabel": "提交咨询" - }, - "success": { - "eyebrow": "COLLABORATION", - "title": "已收到你的咨询", - "intro": "主理人会尽快与你联系。", - "recordsAction": "查看咨询记录", - "homeAction": "返回首页" - }, - "records": { - "title": "我的咨询记录", - "createAction": "新增咨询", - "emptyTitle": "还没有咨询记录", - "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", - "emptyAction": "开始咨询" - } - }, - "founder": "示例主理人" - } } }, "pages": ["pages/index/index", "pages/services/index", "pages/bookings/index"], "visualTemplateKey": "linjing-editorial", "visualPresentation": { - "description": "适合高端定制、建筑作品和项目型个人品牌。", + "description": "适合高端定制的门窗、建筑入口和私宅项目。", "variants": { "hero": "architectural", "offeringList": "editorial", @@ -1937,7 +1792,7 @@ "name": "序章·入户门", "summary": "为别墅入口定制的整樘门系统", "categoryKey": "entrance-door", - "coverUrl": "/assets/content/doors-hero.jpg", + "coverUrl": "/assets/content/entry-door.jpg", "priceText": "按项目确认", "config": { "series": "「万籁」重型天地轴入户系统", @@ -1956,7 +1811,7 @@ }, "media": [ { - "url": "/assets/content/doors-hero.jpg", + "url": "/assets/content/entry-door.jpg", "alt": "", "type": "image" } @@ -1968,7 +1823,7 @@ "name": "庭院·边界门", "summary": "连接建筑与庭院的定制门", "categoryKey": "garden-door", - "coverUrl": "/assets/content/doors-yard-gate.jpg", + "coverUrl": "/assets/content/courtyard-gate.jpg", "priceText": "按项目确认", "config": { "series": "「虚实」透光私家庭院门", @@ -1987,7 +1842,7 @@ }, "media": [ { - "url": "/assets/content/doors-yard-gate.jpg", + "url": "/assets/content/courtyard-gate.jpg", "alt": "", "type": "image" } @@ -1999,7 +1854,7 @@ "name": "室内·静谧门", "summary": "统一室内空间秩序的户内门", "categoryKey": "interior-door", - "coverUrl": "/assets/content/doors-room-door.jpg", + "coverUrl": "/assets/content/interior-door.jpg", "priceText": "按项目确认", "config": { "series": "「空灵」2.8m - 3.2m 满高通顶系统", @@ -2018,7 +1873,7 @@ }, "media": [ { - "url": "/assets/content/doors-room-door.jpg", + "url": "/assets/content/interior-door.jpg", "alt": "", "type": "image" } @@ -2030,7 +1885,7 @@ "name": "一对一门系统设计咨询", "summary": "从现场到方案的完整设计沟通", "categoryKey": "custom", - "coverUrl": "/assets/content/personal-consulting.jpg", + "coverUrl": "/assets/content/design-consultation.jpg", "priceText": "按项目确认", "config": { "series": "「无垠」密室及背景墙融合门", @@ -2049,7 +1904,7 @@ }, "media": [ { - "url": "/assets/content/personal-consulting.jpg", + "url": "/assets/content/design-consultation.jpg", "alt": "", "type": "image" } @@ -2272,8 +2127,8 @@ "phone": "186-0218-9908", "wechat": "LIN-ATELIER-2024", "studioAddress": "上海市静安区威海路设计中心 A 座 / 杭州良渚研造工坊", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/doors-hero.jpg", + "avatarUrl": "/assets/content/founder-portrait.jpg", + "heroImage": "/assets/content/entry-door.jpg", "visualPresentation": { "home": { "founderBadge": "接受项目沟通", @@ -2359,165 +2214,6 @@ "customerRecords": "disabled", "contactActions": "disabled" } - }, - "personal": { - "schemaVersion": "1", - "brand": { - "name": "林境建筑画册 · 预览", - "tagline": "用于独立预览的模板演示内容", - "description": "此内容仅用于平台模板预览,不代表真实品牌或客户案例。", - "deliveryNote": "演示预览已禁用真实咨询和联系操作。" - }, - "content": { - "templateKey": "personal", - "inquiryFormName": "合作咨询表单", - "offerings": [ - { - "kind": "service", - "name": "示例·品牌定位咨询", - "summary": "梳理品牌定位与下一步行动。", - "categoryKey": "consulting", - "coverUrl": "/assets/content/personal-consulting.jpg", - "priceText": "按需求确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-consulting.jpg", - "alt": "", - "type": "image" - } - ] - } - }, - { - "kind": "service", - "name": "示例·长期顾问支持", - "summary": "围绕表达和转化提供持续支持。", - "categoryKey": "advisory", - "coverUrl": "/assets/content/personal-advisory.jpg", - "priceText": "按服务周期确认", - "config": { - "media": [ - { - "url": "/assets/content/personal-advisory.jpg", - "alt": "", - "type": "image" - } - ] - } - } - ], - "trustContent": [ - { - "type": "credential", - "title": "关于主理人", - "content": "示例内容,待品牌主理人完善。" - }, - { - "type": "process", - "title": "合作方法", - "content": "示例内容,待品牌主理人完善。" - } - ], - "fields": [ - { - "key": "name", - "label": "您的称呼", - "type": "text", - "required": true - }, - { - "key": "phone", - "label": "联系方式", - "type": "phone", - "required": true - }, - { - "key": "remark", - "label": "合作需求", - "type": "textarea", - "required": true - } - ], - "capabilityKey": "inquiry", - "brandConfig": { - "templateData": { - "designPhilosophy": "先厘清问题,再设计表达" - }, - "title": "品牌策略顾问", - "slogan": "用清晰的定位与可执行的表达,让专业被看见。", - "phone": "", - "wechat": "", - "studioAddress": "上海市徐汇区创意园区", - "avatarUrl": "/assets/content/personal-avatar.jpg", - "heroImage": "/assets/content/personal-consulting.jpg", - "visualPresentation": { - "home": { - "founderBadge": "接受项目沟通", - "proofEyebrow": "专业经验与合作成果", - "proofTitle": "经验与方法", - "manifestoEyebrow": "工作原则", - "manifestoTitle": "先厘清问题,再设计表达", - "worksEyebrow": "合作方式", - "worksTitle": "品牌策略与顾问服务", - "worksAction": "查看全部 →" - }, - "offerings": { - "title": "合作方式", - "subtitle": "围绕定位、表达与业务转化,选择适合当前阶段的支持。", - "materialLabel": "包含:", - "hardwareLabel": "定制说明:", - "detailAction": "查看详情 →", - "inquiryAction": "发起咨询" - }, - "detail": { - "priceLabel": "价格参考", - "spaceLabel": "适合场景", - "backgroundTitle": "项目背景", - "conceptTitle": "设计思路", - "craftsTitle": "交付要点", - "materialsTitle": "材料与说明", - "inquiryAction": "发起咨询", - "inquiryHint": "提交信息后由主理人与您沟通。" - }, - "profile": { - "phoneLabel": "联系电话", - "wechatLabel": "微信", - "addressLabel": "工作地点", - "callAction": "呼叫", - "copyAction": "复制", - "recordsTitle": "我的咨询记录", - "recordsCountUnit": "条记录" - }, - "inquiry": { - "eyebrow": "COLLABORATION", - "title": "合作咨询", - "subtitle": "留下你的需求与目标,主理人会尽快联系。", - "submitLabel": "提交咨询" - }, - "success": { - "eyebrow": "COLLABORATION", - "title": "已收到你的咨询", - "intro": "主理人会尽快与你联系。", - "recordsAction": "查看咨询记录", - "homeAction": "返回首页" - }, - "records": { - "title": "我的咨询记录", - "createAction": "新增咨询", - "emptyTitle": "还没有咨询记录", - "emptyDescription": "提交一次咨询,开始与你的主理人沟通。", - "emptyAction": "开始咨询" - } - }, - "founder": "示例主理人" - } - }, - "safety": { - "submissions": "disabled", - "customerRecords": "disabled", - "contactActions": "disabled" - } } } } diff --git a/scripts/template-compatibility.test.mjs b/scripts/template-compatibility.test.mjs index c92720e..7ba4bd7 100644 --- a/scripts/template-compatibility.test.mjs +++ b/scripts/template-compatibility.test.mjs @@ -19,6 +19,13 @@ test("compatibility report discovers deployed package, industry, visual and rend (item) => item.packageKey === "linjing-editorial" && item.industry === "doors", ), ); + assert.equal( + report.packages.some( + (item) => item.packageKey === "linjing-editorial" && item.industry === "personal", + ), + false, + "林境建筑画册不得出现在 personal 兼容矩阵中", + ); }); test("compatibility check rejects renderer, capability and toolchain incompatibilities", () => {