7385785504
- viewer/admin 错误码→文案映射按契约 ErrorCodes 枚举全集登记(机器守护 spec 遍历枚举断言无缺漏 + 映射键在 zh/en 词条均存在 + locale 键集 递归相等);mobile 镜像补齐 DOWNLOAD_DISABLED(P4a 增补漏登) - 漏译修复:viewer.photoRemoved en 侧缺失(审计测试捕获); DOWNLOAD_DISABLED 观众侧专属文案 + useDownload 专属提示接线; admin apiMsg 增 RATE_LIMITED/ALBUM_NOT_PUBLIC/DOWNLOAD_DISABLED/ SYNC_AUTH_FAILED 四码词条 - 运行时抽查:admin 主旅程 en 版 e2e(登录→相册管理全英文 + 偏好 持久);embed iframe lang=en 渲染与深链跟随 e2e(zh 侧既有用例覆盖) - contracts 新增 ./errors 浏览器安全子路径(errors.ts 纯 TS); admin 增 @photo/contracts devDep(仅测试消费) Co-Authored-By: Claude Code <noreply@anthropic.com>
48 lines
1.7 KiB
JSON
48 lines
1.7 KiB
JSON
{
|
|
"name": "@photo/contracts",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"description": "API contract single source of truth (OpenAPI 3.1 + error codes); types generated via openapi-typescript and committed under src/generated/. Subpaths ./constants and ./errors are the browser-safe entries (root index re-exports internal-sync with node:crypto — browser apps like viewer must import runtime values from those; errors.ts is pure TS).",
|
|
"//": "lint runs `eslint .` against the root flat config (Task 7). test is ts-jest with full type-checking (Task 6 type tests).",
|
|
"main": "./dist/index.js",
|
|
"types": "./dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"default": "./dist/index.js"
|
|
},
|
|
"./constants": {
|
|
"types": "./dist/constants.d.ts",
|
|
"default": "./dist/constants.js"
|
|
},
|
|
"./errors": {
|
|
"types": "./dist/errors.d.ts",
|
|
"default": "./dist/errors.js"
|
|
},
|
|
"./realtime": {
|
|
"types": "./dist/realtime.d.ts",
|
|
"default": "./dist/realtime.js"
|
|
},
|
|
"./openapi.yaml": "./openapi.yaml",
|
|
"./package.json": "./package.json"
|
|
},
|
|
"scripts": {
|
|
"gen": "openapi-typescript openapi.yaml -o src/generated/openapi.d.ts",
|
|
"lint:api": "redocly lint openapi.yaml",
|
|
"build": "tsc -p tsconfig.json && node -e \"require('fs').cpSync('src/generated', 'dist/generated', { recursive: true })\"",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "jest",
|
|
"lint": "eslint ."
|
|
},
|
|
"devDependencies": {
|
|
"@redocly/cli": "^1.0.0",
|
|
"@types/jest": "^29.5.0",
|
|
"@types/node": "^22.10.0",
|
|
"jest": "^29.7.0",
|
|
"openapi-typescript": "^7.0.0",
|
|
"ts-jest": "^29.2.0",
|
|
"typescript": "^5.6.0"
|
|
}
|
|
}
|