2026-09-17 17:04:12 +08:00
{
"name" : "@photo/contracts" ,
"version" : "0.1.0" ,
"private" : true ,
"type" : "module" ,
2026-09-20 23:44:27 +08:00
"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)." ,
2026-09-17 19:14:41 +08:00
"//" : "lint runs `eslint .` against the root flat config (Task 7). test is ts-jest with full type-checking (Task 6 type tests)." ,
2026-09-17 17:04:12 +08:00
"main" : "./dist/index.js" ,
"types" : "./dist/index.d.ts" ,
"exports" : {
"." : {
"types" : "./dist/index.d.ts" ,
"default" : "./dist/index.js"
},
2026-09-20 23:02:07 +08:00
"./constants" : {
"types" : "./dist/constants.d.ts" ,
"default" : "./dist/constants.js"
},
2026-09-20 23:44:27 +08:00
"./errors" : {
"types" : "./dist/errors.d.ts" ,
"default" : "./dist/errors.js"
},
2026-09-18 19:52:27 +08:00
"./realtime" : {
"types" : "./dist/realtime.d.ts" ,
"default" : "./dist/realtime.js"
},
2026-09-17 17:31:11 +08:00
"./openapi.yaml" : "./openapi.yaml" ,
"./package.json" : "./package.json"
2026-09-17 17:04:12 +08:00
},
"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" ,
2026-09-17 19:14:41 +08:00
"lint" : "eslint ."
2026-09-17 17:04:12 +08:00
},
"devDependencies" : {
"@redocly/cli" : "^1.0.0" ,
"@types/jest" : "^29.5.0" ,
2026-09-18 15:21:41 +08:00
"@types/node" : "^22.10.0" ,
2026-09-17 17:04:12 +08:00
"jest" : "^29.7.0" ,
"openapi-typescript" : "^7.0.0" ,
"ts-jest" : "^29.2.0" ,
"typescript" : "^5.6.0"
}
}