2801e4f158
packages/db-cn:@photo/db-cn(prisma 5.22,api/worker 共享 client)+ schema(users/sessions/audit_logs,DateTime(6)、cuid、账号唯一)。 迁移 SQL 手工改写表级 collation 为 utf8mb4_0900_bin——Prisma 生成的 MySQL DDL 固定 utf8mb4_unicode_ci 会覆盖库级 bin collation,账号/token 大小写 敏感语义依赖它(后续迁移需同样复核)。services/api:@Global PrismaModule (PrismaService 封装 $connect/$disconnect,池上限仍由 DATABASE_URL_CN ?connection_limit=10 承担);reset.ts 落地 FK 包裹式 TRUNCATE;e2e 语义复核 4 例(UTC 往返/大小写敏感/audit Json+actor/ session FK Restrict P2003)。pnpm 10 未拦截 prisma engines(平台包内置), 无需 onlyBuiltDependencies。 Co-Authored-By: Claude Code <noreply@anthropic.com>
39 lines
1.1 KiB
JSON
39 lines
1.1 KiB
JSON
{
|
|
"name": "@photo/api-cn",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "CN NestJS API service (P1a skeleton: bootstrap, /v1/health, request-id, error envelope)",
|
|
"scripts": {
|
|
"build": "tsc -p tsconfig.build.json",
|
|
"start": "tsc -p tsconfig.build.json && node dist/main-cn.js",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint .",
|
|
"test": "jest",
|
|
"test:e2e": "jest --config jest.e2e.config.ts"
|
|
},
|
|
"dependencies": {
|
|
"@nestjs/common": "^10.4.6",
|
|
"@nestjs/core": "^10.4.6",
|
|
"@nestjs/platform-express": "^10.4.6",
|
|
"@photo/contracts": "workspace:*",
|
|
"@photo/db-cn": "workspace:*",
|
|
"nestjs-pino": "^4.6.1",
|
|
"pino": "^10.0.0",
|
|
"pino-http": "^11.0.0",
|
|
"reflect-metadata": "^0.2.2",
|
|
"rxjs": "^7.8.1"
|
|
},
|
|
"devDependencies": {
|
|
"@nestjs/testing": "^10.4.6",
|
|
"@types/jest": "^29.5.13",
|
|
"@types/node": "^22.10.0",
|
|
"@types/supertest": "^6.0.2",
|
|
"dotenv": "^16.4.5",
|
|
"jest": "^29.7.0",
|
|
"supertest": "^7.0.0",
|
|
"ts-jest": "^29.2.5",
|
|
"ts-node": "^10.9.2",
|
|
"typescript": "^5.6.0"
|
|
}
|
|
}
|