test: 增加 API 路由覆盖门禁
This commit is contained in:
1 parent
5d88cb2040
commit
f02e2cafbb
8 files changed
+2477
-719
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"scope": "模板完成证据登记,保留命令、日志与产物哈希",
|
||||
"generatedAt": "2026-10-19T02:30:00+08:00",
|
||||
"generatedAt": "2026-10-19T20:11:56.461+08:00",
|
||||
"templates": {
|
||||
"acheng-campus-food": {
|
||||
"real-manifest-interaction": {
|
||||
@@ -13,7 +13,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
},
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log",
|
||||
@@ -30,7 +30,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
}
|
||||
],
|
||||
"exitCode": 0
|
||||
@@ -105,7 +105,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
},
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log",
|
||||
@@ -122,7 +122,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
}
|
||||
],
|
||||
"exitCode": 0
|
||||
@@ -197,7 +197,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
},
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/admin-editor.log",
|
||||
@@ -214,7 +214,7 @@
|
||||
"artifacts": [
|
||||
{
|
||||
"path": ".codex-tasks/template-audit-execution/raw/evidence-2026-10-19/api-integration.log",
|
||||
"sha256": "7cd8897ba289da75cf88cb54aa5eb42b15dfcc080ef7ba0a79499864ebcfbabb"
|
||||
"sha256": "15a52767f4aeab336095a8046075e8a5817d2dc7400695ea9fa10c19072b1bd6"
|
||||
}
|
||||
],
|
||||
"exitCode": 0
|
||||
@@ -292,5 +292,5 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourceTreeHash": "44b16c0f22a737b6d53db2923b45957289aa50f9355b02a44e6cc72323d7b3c8"
|
||||
"sourceTreeHash": "34ff0c48bc5a76d57949e3fa234865f0a940ed3cd87f75ac2d7f5abee81fa5cd"
|
||||
}
|
||||
+709
-697
File diff suppressed because it is too large.
Load diff
@@ -24,6 +24,7 @@ jobs:
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm check
|
||||
- run: pnpm test:api-routes
|
||||
- run: pnpm audit --prod --registry=https://registry.npmjs.org
|
||||
- run: pnpm validate:templates
|
||||
- run: pnpm template:compatibility
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,642 @@
|
||||
export type HttpMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
|
||||
|
||||
export type RouteAuth = "public" | "customer" | "token" | "brand" | "roles" | "template-admin";
|
||||
|
||||
export type RouteCoverage = {
|
||||
method: HttpMethod;
|
||||
path: string;
|
||||
auth: RouteAuth;
|
||||
roles?: string[];
|
||||
authorizationTest: string | null;
|
||||
successTest: string;
|
||||
};
|
||||
|
||||
export const ROUTE_COVERAGE: RouteCoverage[] = [
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "/admin/config/trust-content/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage trust content",
|
||||
successTest: "admin can manage trust content",
|
||||
},
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "/admin/workspace/fields/:id",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "admin can customize workspace fields with brand isolation",
|
||||
successTest: "admin can customize workspace fields with brand isolation",
|
||||
},
|
||||
{
|
||||
method: "DELETE",
|
||||
path: "/admin/workspace/offerings/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
successTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/bookings",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin booking endpoints reject missing or customer credentials",
|
||||
successTest: "seeded admin can log in and read protected booking resources",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/bookings/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can inspect booking follow-up and tags",
|
||||
successTest: "admin can inspect booking follow-up and tags",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/bookings/tags",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can inspect booking follow-up and tags",
|
||||
successTest: "admin can inspect booking follow-up and tags",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/bookings/unread-count",
|
||||
auth: "brand",
|
||||
authorizationTest: "seeded admin can log in and read protected booking resources",
|
||||
successTest: "seeded admin can log in and read protected booking resources",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/brands",
|
||||
auth: "brand",
|
||||
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/members",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "manually created member must change the initial password before normal use",
|
||||
successTest: "owner can manage brand members without removing the final owner",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/config/brand",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can read and update brand and service configuration",
|
||||
successTest: "admin can read and update brand and service configuration",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/config/trust-content",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage trust content",
|
||||
successTest: "admin can manage trust content",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/miniapp-releases",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
successTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/miniapp-releases/latest",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
successTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/miniapp-releases/settings",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release settings never expose or persist plaintext private keys",
|
||||
successTest: "miniapp release settings never expose or persist plaintext private keys",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/releases",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
successTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/releases/readiness",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
successTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/session/current",
|
||||
auth: "token",
|
||||
authorizationTest:
|
||||
"admin session cookie drives current session and rejects invalid credentials",
|
||||
successTest: "admin session cookie drives current session and rejects invalid credentials",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/template-operations/failures",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板失败指标仅平台模板管理员可查,按窗口聚合且不暴露操作内容",
|
||||
successTest: "模板失败指标仅平台模板管理员可查,按窗口聚合且不暴露操作内容",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/templates",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/templates/:id/audit",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/templates/:id/preview",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "平台模板管理员可以按行业预览版本,且预览不写入品牌数据",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/uploads/config",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin upload endpoints authorize and persist local media",
|
||||
successTest: "admin upload endpoints authorize and persist local media",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can customize workspace fields with brand isolation",
|
||||
successTest: "admin can customize workspace fields with brand isolation",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/capabilities",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "admin can update declared capability status with authorization and audit",
|
||||
successTest: "admin capability list includes template defaults and brand overrides",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/forms",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/offerings",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
successTest: "admin can read and update brand and service configuration",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/preview",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin preview workspace is authorized and brand-scoped draft runtime",
|
||||
successTest: "admin preview workspace is authorized and brand-scoped draft runtime",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/sample-content/preview",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can preview and import sample content idempotently",
|
||||
successTest: "admin can preview and import sample content idempotently",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/submissions",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/admin/workspace/template/preview",
|
||||
auth: "brand",
|
||||
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: "/customer/bookings",
|
||||
auth: "customer",
|
||||
authorizationTest: "customer booking endpoints require a valid customer session",
|
||||
successTest: "customer booking endpoints require a valid customer session",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/customer/inquiry-submissions",
|
||||
auth: "customer",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/customer/inquiry-submissions/:id",
|
||||
auth: "customer",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/health",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "health and public content are available without authentication",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/brand",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "health and public content are available without authentication",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/inquiry-forms/:id",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/offerings",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "health and public content are available without authentication",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/offerings/:id",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/templates",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest:
|
||||
"visual template compatibility is enforced by catalog, preview, and version selection",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/templates/:key",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "health and public content are available without authentication",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/templates/preview",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest:
|
||||
"visual template compatibility is enforced by catalog, preview, and version selection",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/trust-content",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "admin can manage trust content",
|
||||
},
|
||||
{
|
||||
method: "GET",
|
||||
path: "/public/workspace",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "health and public content are available without authentication",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/brands/members/:id",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "owner can manage brand members without removing the final owner",
|
||||
successTest: "owner can manage brand members without removing the final owner",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/config/brand",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can read and update brand and service configuration",
|
||||
successTest: "admin can read and update brand and service configuration",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/config/presentation",
|
||||
auth: "brand",
|
||||
authorizationTest:
|
||||
"admin can update user-facing brand presentation without replacing other config",
|
||||
successTest: "admin can update user-facing brand presentation without replacing other config",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/config/trust-content/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage trust content",
|
||||
successTest: "admin can manage trust content",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/miniapp-releases/:id/status",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
successTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/miniapp-releases/settings",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "miniapp release settings never expose or persist plaintext private keys",
|
||||
successTest: "miniapp release settings never expose or persist plaintext private keys",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/workspace/capabilities/:key",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "admin can update declared capability status with authorization and audit",
|
||||
successTest: "admin can update declared capability status with authorization and audit",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/workspace/fields/:id",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "admin can customize workspace fields with brand isolation",
|
||||
successTest: "admin can customize workspace fields with brand isolation",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/workspace/forms/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/workspace/offerings/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
successTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
},
|
||||
{
|
||||
method: "PATCH",
|
||||
path: "/admin/workspace/submissions/:id",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/bookings/:id/read",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can inspect booking follow-up and tags",
|
||||
successTest: "admin can inspect booking follow-up and tags",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/bookings/:id/status",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can advance booking status but cannot skip the state machine",
|
||||
successTest: "admin can advance booking status but cannot skip the state machine",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/bookings/:id/tags",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can inspect booking follow-up and tags",
|
||||
successTest: "admin can inspect booking follow-up and tags",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/bookings/tags",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can inspect booking follow-up and tags",
|
||||
successTest: "admin can inspect booking follow-up and tags",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/brands/:brandId/switch",
|
||||
auth: "brand",
|
||||
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/members",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "owner can manage brand members without removing the final owner",
|
||||
successTest: "owner can manage brand members without removing the final owner",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/config/trust-content",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage trust content",
|
||||
successTest: "admin can manage trust content",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/miniapp-releases",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
successTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/miniapp-releases/:id/upload",
|
||||
auth: "brand",
|
||||
authorizationTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
successTest: "miniapp release tasks are authorized, idempotent, and state checked",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/releases/:version/rollback",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
successTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/releases/publish",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
successTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/releases/revoke",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
successTest: "admin release lifecycle is authorized, brand-scoped, and versioned",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/session/change-password",
|
||||
auth: "token",
|
||||
authorizationTest: "changing an admin password revokes existing admin tokens",
|
||||
successTest: "changing an admin password revokes existing admin tokens",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/session/login",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "admin logout revokes the current token",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/session/logout",
|
||||
auth: "token",
|
||||
authorizationTest: "admin logout revokes the current token",
|
||||
successTest: "admin logout revokes the current token",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/templates/:id/publish",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/templates/:id/retire",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/templates/import",
|
||||
auth: "template-admin",
|
||||
authorizationTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
successTest: "模板目录只允许平台模板管理员访问,并支持安全、幂等导入",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/uploads/presign",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin upload endpoints authorize and persist local media",
|
||||
successTest: "admin upload endpoints authorize and persist local media",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/fields",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "admin can customize workspace fields with brand isolation",
|
||||
successTest: "admin can customize workspace fields with brand isolation",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/forms",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/install",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "industry template state has a single source of truth",
|
||||
successTest: "industry template state has a single source of truth",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/offerings",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
successTest: "admin can manage offerings and public endpoint hides disabled offerings",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/sample-content/import",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin can preview and import sample content idempotently",
|
||||
successTest: "admin can preview and import sample content idempotently",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/template/rollback",
|
||||
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: "POST",
|
||||
path: "/admin/workspace/template/select-version",
|
||||
auth: "roles",
|
||||
roles: ["owner", "admin", "platform-admin"],
|
||||
authorizationTest: "selected package version is reflected in public runtime workspace",
|
||||
successTest:
|
||||
"visual template compatibility is enforced by catalog, preview, and version selection",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/admin/workspace/template/upgrade",
|
||||
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: "POST",
|
||||
path: "/customer/bookings",
|
||||
auth: "customer",
|
||||
authorizationTest: "customer booking endpoints require a valid customer session",
|
||||
successTest: "customer can create a generic inquiry without food-specific fields",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/customer/bookings/:id/cancel",
|
||||
auth: "customer",
|
||||
authorizationTest: "customer can create and cancel a package booking",
|
||||
successTest: "customer can create and cancel a package booking",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/customer/inquiry-submissions",
|
||||
auth: "customer",
|
||||
authorizationTest: "admin can create and version an inquiry form",
|
||||
successTest: "admin can create and version an inquiry form",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/customer/session/logout",
|
||||
auth: "customer",
|
||||
authorizationTest: "customer logout revokes the current token",
|
||||
successTest: "customer logout revokes the current token",
|
||||
},
|
||||
{
|
||||
method: "POST",
|
||||
path: "/customer/session/wechat",
|
||||
auth: "public",
|
||||
authorizationTest: null,
|
||||
successTest: "wechat login creates a customer session for the requested brand",
|
||||
},
|
||||
{
|
||||
method: "PUT",
|
||||
path: "/admin/uploads/local",
|
||||
auth: "brand",
|
||||
authorizationTest: "admin upload endpoints authorize and persist local media",
|
||||
successTest: "admin upload endpoints authorize and persist local media",
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,369 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFileSync, readdirSync, statSync } from "node:fs";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { test } from "node:test";
|
||||
import "reflect-metadata";
|
||||
import { RequestMethod } from "@nestjs/common";
|
||||
import { ADMIN_AUTH_METADATA, type AdminAuthMetadata } from "../src/admin-auth.decorators.js";
|
||||
import { ROUTE_COVERAGE, type HttpMethod, type RouteAuth } from "./route-coverage.matrix.js";
|
||||
|
||||
type DiscoveredRoute = {
|
||||
method: HttpMethod;
|
||||
path: string;
|
||||
auth: RouteAuth;
|
||||
roles?: string[];
|
||||
controller: string;
|
||||
handler: string;
|
||||
};
|
||||
|
||||
type RequestEvidence = {
|
||||
kind: "request" | "authorization-boundary";
|
||||
method: HttpMethod | null;
|
||||
path: string | null;
|
||||
start: number;
|
||||
end: number;
|
||||
};
|
||||
|
||||
const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
|
||||
const API_ROOT = path.resolve(TEST_DIRECTORY, "..");
|
||||
const CONTROLLER_ROOT = path.join(API_ROOT, "src/modules");
|
||||
const INTEGRATION_TEST_PATH = path.join(TEST_DIRECTORY, "http.integration.test.js");
|
||||
const REQUIRED_PROTECTED_REJECTIONS = [401, 403] as const;
|
||||
|
||||
function routeKey(route: Pick<DiscoveredRoute, "method" | "path">): string {
|
||||
return `${route.method} ${route.path}`;
|
||||
}
|
||||
|
||||
function walk(directory: string): string[] {
|
||||
return readdirSync(directory).flatMap((entry) => {
|
||||
const fullPath = path.join(directory, entry);
|
||||
return statSync(fullPath).isDirectory() ? walk(fullPath) : [fullPath];
|
||||
});
|
||||
}
|
||||
|
||||
function classifyUnauthenticatedRoute(method: HttpMethod, routePath: string): RouteAuth {
|
||||
if (
|
||||
routePath === "/health" ||
|
||||
routePath.startsWith("/public/") ||
|
||||
(method === "POST" && routePath === "/admin/session/login") ||
|
||||
(method === "POST" && routePath === "/customer/session/wechat")
|
||||
) {
|
||||
return "public";
|
||||
}
|
||||
if (routePath.startsWith("/customer/")) return "customer";
|
||||
throw new Error(`Route ${method} ${routePath} has no recognizable authorization contract`);
|
||||
}
|
||||
|
||||
function readAuthMetadata(
|
||||
controller: object,
|
||||
handler: (...args: unknown[]) => unknown,
|
||||
): AdminAuthMetadata | undefined {
|
||||
return (
|
||||
(Reflect.getMetadata(ADMIN_AUTH_METADATA, handler) as AdminAuthMetadata | undefined) ??
|
||||
(Reflect.getMetadata(ADMIN_AUTH_METADATA, controller) as AdminAuthMetadata | undefined)
|
||||
);
|
||||
}
|
||||
|
||||
async function discoverRoutes(): Promise<DiscoveredRoute[]> {
|
||||
// 以内容标识发现 Controller,避免新增文件未遵循 *controller.ts 命名时被静默漏测。
|
||||
const controllerFiles = walk(CONTROLLER_ROOT).filter(
|
||||
(file) =>
|
||||
file.endsWith(".ts") &&
|
||||
!file.endsWith(".d.ts") &&
|
||||
/@Controller\s*\(/.test(readFileSync(file, "utf8")),
|
||||
);
|
||||
const discovered: DiscoveredRoute[] = [];
|
||||
|
||||
for (const file of controllerFiles) {
|
||||
const module = await import(pathToFileURL(file).href);
|
||||
for (const value of Object.values(module)) {
|
||||
if (typeof value !== "function" || !Reflect.hasMetadata("path", value)) continue;
|
||||
|
||||
const controllerPath = Reflect.getMetadata("path", value) as string;
|
||||
for (const handlerName of Object.getOwnPropertyNames(value.prototype)) {
|
||||
if (handlerName === "constructor") continue;
|
||||
const handler = value.prototype[handlerName] as (...args: unknown[]) => unknown;
|
||||
const method = Reflect.getMetadata("method", handler) as RequestMethod | undefined;
|
||||
if (method === undefined) continue;
|
||||
|
||||
const methodName = RequestMethod[method] as HttpMethod;
|
||||
const handlerPath = (Reflect.getMetadata("path", handler) as string | undefined) ?? "";
|
||||
const routePath =
|
||||
`/${controllerPath}/${handlerPath}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
||||
const metadata = readAuthMetadata(value, handler);
|
||||
const auth = metadata?.type ?? classifyUnauthenticatedRoute(methodName, routePath);
|
||||
|
||||
discovered.push({
|
||||
method: methodName,
|
||||
path: routePath,
|
||||
auth,
|
||||
roles: metadata?.type === "roles" ? metadata.roles : undefined,
|
||||
controller: value.name,
|
||||
handler: handlerName,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return discovered.sort((left, right) => routeKey(left).localeCompare(routeKey(right)));
|
||||
}
|
||||
|
||||
function readIntegrationTests(): Map<string, string> {
|
||||
const source = readFileSync(INTEGRATION_TEST_PATH, "utf8");
|
||||
const starts = [...source.matchAll(/^test\("([^"]+)"/gm)].map((match) => ({
|
||||
name: match[1],
|
||||
index: match.index,
|
||||
}));
|
||||
return new Map(
|
||||
starts.map((entry, index) => [
|
||||
entry.name,
|
||||
source.slice(entry.index, starts[index + 1]?.index ?? source.length),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
function findClosingParen(source: string, openIndex: number): number {
|
||||
let depth = 0;
|
||||
let quote: '"' | "'" | "`" | null = null;
|
||||
let escaped = false;
|
||||
|
||||
for (let index = openIndex; index < source.length; index += 1) {
|
||||
const character = source[index];
|
||||
if (quote) {
|
||||
if (escaped) {
|
||||
escaped = false;
|
||||
} else if (character === "\\") {
|
||||
escaped = true;
|
||||
} else if (character === quote) {
|
||||
quote = null;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (character === '"' || character === "'" || character === "`") {
|
||||
quote = character;
|
||||
} else if (character === "(") {
|
||||
depth += 1;
|
||||
} else if (character === ")") {
|
||||
depth -= 1;
|
||||
if (depth === 0) return index;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
function readFirstStringArgument(callText: string): string | null {
|
||||
const prefix = callText.match(/^\s*(?:request|json|assertProtectedRouteBoundary)\s*\(\s*/)?.[0];
|
||||
if (!prefix) return null;
|
||||
const quote = callText[prefix.length];
|
||||
if (quote !== '"' && quote !== "'" && quote !== "`") return null;
|
||||
|
||||
let escaped = false;
|
||||
for (let index = prefix.length + 1; index < callText.length; index += 1) {
|
||||
const character = callText[index];
|
||||
if (escaped) {
|
||||
escaped = false;
|
||||
} else if (character === "\\") {
|
||||
escaped = true;
|
||||
} else if (character === quote) {
|
||||
return callText.slice(prefix.length + 1, index);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function normalizeEvidencePath(value: string): string {
|
||||
const pathname = value.split(/[?#]/, 1)[0].replace(/\$\{[^}]+\}/g, ":param");
|
||||
const normalized = pathname.replace(/\/+$/, "");
|
||||
return normalized || "/";
|
||||
}
|
||||
|
||||
function findRequestEvidence(source: string): RequestEvidence[] {
|
||||
const evidence: RequestEvidence[] = [];
|
||||
for (const match of source.matchAll(/\b(?:request|json|assertProtectedRouteBoundary)\s*\(/g)) {
|
||||
const openIndex = match.index + match[0].lastIndexOf("(");
|
||||
const closeIndex = findClosingParen(source, openIndex);
|
||||
if (closeIndex < 0) continue;
|
||||
|
||||
const callText = source.slice(match.index, closeIndex + 1);
|
||||
const literalPath = readFirstStringArgument(callText);
|
||||
const explicitMethod = callText.match(
|
||||
/\bmethod\s*:\s*["'](DELETE|GET|PATCH|POST|PUT)["']/,
|
||||
)?.[1] as HttpMethod | undefined;
|
||||
const hasDynamicMethod = /\bmethod\s*:\s*[A-Za-z_$]/.test(callText);
|
||||
const method = explicitMethod ?? (hasDynamicMethod ? null : "GET");
|
||||
|
||||
evidence.push({
|
||||
kind: match[0].includes("assertProtectedRouteBoundary")
|
||||
? "authorization-boundary"
|
||||
: "request",
|
||||
method,
|
||||
path: literalPath === null ? null : normalizeEvidencePath(literalPath),
|
||||
start: match.index,
|
||||
end: closeIndex + 1,
|
||||
});
|
||||
}
|
||||
return evidence;
|
||||
}
|
||||
|
||||
function routePathMatches(routePath: string, evidencePath: string): boolean {
|
||||
const expectedSegments = routePath.split("/");
|
||||
const actualSegments = evidencePath.split("/");
|
||||
if (expectedSegments.length !== actualSegments.length) return false;
|
||||
|
||||
return expectedSegments.every((segment, index) => {
|
||||
if (segment.startsWith(":")) return actualSegments[index].length > 0;
|
||||
return segment === actualSegments[index];
|
||||
});
|
||||
}
|
||||
|
||||
function findRouteEvidence(
|
||||
source: string,
|
||||
route: Pick<DiscoveredRoute, "method" | "path">,
|
||||
): RequestEvidence[] {
|
||||
return findRequestEvidence(source).filter(
|
||||
(evidence) =>
|
||||
evidence.method === route.method &&
|
||||
evidence.path !== null &&
|
||||
routePathMatches(route.path, evidence.path),
|
||||
);
|
||||
}
|
||||
|
||||
function rejectionStatusesForRoute(
|
||||
source: string,
|
||||
route: Pick<DiscoveredRoute, "method" | "path">,
|
||||
): Set<number> {
|
||||
const allEvidence = findRequestEvidence(source);
|
||||
const statuses = new Set<number>();
|
||||
for (const [index, evidence] of allEvidence.entries()) {
|
||||
if (
|
||||
evidence.method !== route.method ||
|
||||
evidence.path === null ||
|
||||
!routePathMatches(route.path, evidence.path)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (evidence.kind === "authorization-boundary") {
|
||||
statuses.add(401);
|
||||
statuses.add(403);
|
||||
continue;
|
||||
}
|
||||
|
||||
const contextEnd = allEvidence[index + 1]?.start ?? source.length;
|
||||
const context = source.slice(evidence.start, contextEnd);
|
||||
for (const statusMatch of context.matchAll(/statusCode,\s*(401|403)\b/g)) {
|
||||
statuses.add(Number(statusMatch[1]));
|
||||
}
|
||||
}
|
||||
return statuses;
|
||||
}
|
||||
|
||||
test("every API route has an explicit authorization and success coverage contract", async () => {
|
||||
const matrix = new Map<string, (typeof ROUTE_COVERAGE)[number]>();
|
||||
for (const route of ROUTE_COVERAGE) {
|
||||
const key = routeKey(route);
|
||||
assert.equal(matrix.has(key), false, `Route coverage matrix contains duplicate ${key}`);
|
||||
matrix.set(key, route);
|
||||
}
|
||||
|
||||
const discovered = await discoverRoutes();
|
||||
const discoveredKeys = new Set(discovered.map(routeKey));
|
||||
assert.equal(
|
||||
discoveredKeys.size,
|
||||
discovered.length,
|
||||
"NestJS controllers expose duplicate HTTP method and path pairs",
|
||||
);
|
||||
const missingCoverage = discovered.filter((route) => !matrix.has(routeKey(route)));
|
||||
const staleCoverage = [...matrix.keys()].filter((key) => !discoveredKeys.has(key));
|
||||
|
||||
assert.deepEqual(
|
||||
missingCoverage.map(routeKey),
|
||||
[],
|
||||
"API routes missing from test/route-coverage.matrix.ts",
|
||||
);
|
||||
assert.deepEqual(staleCoverage, [], "Route coverage matrix contains routes that no longer exist");
|
||||
|
||||
for (const route of discovered) {
|
||||
const coverage = matrix.get(routeKey(route));
|
||||
assert.ok(coverage, `Missing coverage entry for ${routeKey(route)}`);
|
||||
assert.equal(
|
||||
coverage.auth,
|
||||
route.auth,
|
||||
`${routeKey(route)} authorization mismatch (${route.controller}.${route.handler})`,
|
||||
);
|
||||
if (route.auth === "roles") {
|
||||
assert.deepEqual(
|
||||
coverage.roles,
|
||||
route.roles,
|
||||
`${routeKey(route)} role allow-list mismatch (${route.controller}.${route.handler})`,
|
||||
);
|
||||
} else {
|
||||
assert.equal(coverage.roles, undefined, `${routeKey(route)} must not declare roles`);
|
||||
}
|
||||
}
|
||||
|
||||
const integrationTests = readIntegrationTests();
|
||||
const coverageFailures: string[] = [];
|
||||
for (const route of ROUTE_COVERAGE) {
|
||||
const successBlock = integrationTests.get(route.successTest);
|
||||
if (!successBlock) {
|
||||
coverageFailures.push(`${routeKey(route)} successTest does not exist: ${route.successTest}`);
|
||||
continue;
|
||||
}
|
||||
if (findRouteEvidence(successBlock, route).length === 0) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} successTest does not call the exact method and path: ${route.successTest}`,
|
||||
);
|
||||
}
|
||||
if (!/statusCode,\s*(200|201)\b/.test(successBlock)) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} successTest has no successful response assertion: ${route.successTest}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (route.auth === "public") {
|
||||
if (route.authorizationTest !== null) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} is public and must not claim an authorization test`,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!route.authorizationTest) {
|
||||
coverageFailures.push(`${routeKey(route)} is protected and requires authorizationTest`);
|
||||
continue;
|
||||
}
|
||||
const authorizationBlock = integrationTests.get(route.authorizationTest);
|
||||
if (!authorizationBlock) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} authorizationTest does not exist: ${route.authorizationTest}`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
if (findRouteEvidence(authorizationBlock, route).length === 0) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} authorizationTest does not call the exact method and path: ${route.authorizationTest}`,
|
||||
);
|
||||
}
|
||||
const rejectionStatuses = [...rejectionStatusesForRoute(authorizationBlock, route)].sort();
|
||||
if (
|
||||
rejectionStatuses.length !== REQUIRED_PROTECTED_REJECTIONS.length ||
|
||||
rejectionStatuses.some((status, index) => status !== REQUIRED_PROTECTED_REJECTIONS[index])
|
||||
) {
|
||||
coverageFailures.push(
|
||||
`${routeKey(route)} authorizationTest must associate missing-credential 401 and wrong-role 403 with the exact route; found [${rejectionStatuses.join(", ")}]: ${route.authorizationTest}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
assert.deepEqual(
|
||||
coverageFailures,
|
||||
[],
|
||||
`Route coverage contract failures:\n${coverageFailures.join("\n")}`,
|
||||
);
|
||||
});
|
||||
@@ -7,6 +7,7 @@
|
||||
- 明确接口的认证要求、角色、品牌隔离和状态转换;
|
||||
- 测试缺少凭证、凭证无效或角色错误,以及成功授权路径;
|
||||
- 测试成功响应、业务校验失败和资源不存在;
|
||||
- 新增、删除或调整任意 Controller route 时,同步更新 `apps/api/test/route-coverage.matrix.ts`,并运行 `pnpm test:api-routes`;矩阵必须由 NestJS metadata 动态发现结果校验,禁止依赖手工维护的路由清单自证;
|
||||
- 发布与撤回类端点还需覆盖并发版本分配、发布快照与客户提交的一致性;
|
||||
- API Client 方法、请求类型、响应类型和调用页面同步更新;
|
||||
- 状态码、错误 code、错误 message 和 `requestId` 符合统一响应约定。
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"db:migrate": "pnpm --filter @personal-brand/api db:migrate",
|
||||
"db:seed": "pnpm --filter @personal-brand/api db:seed",
|
||||
"test:api-client": "pnpm --filter @personal-brand/api exec tsx --test ../../packages/api-client/test/**/*.test.ts",
|
||||
"test:api-routes": "pnpm --filter @personal-brand/api exec tsx --test test/route-coverage.test.ts",
|
||||
"validate:templates": "node scripts/validate-template-packages.cjs && pnpm --filter @personal-brand/template-contract test",
|
||||
"generate:template-catalog": "node scripts/generate-template-catalog.cjs --write",
|
||||
"template:dev": "node packages/template-compiler/src/cli.mjs --template",
|
||||
|
||||
Reference in new issue
Block a user