Files
order_site/apps/backend/package.json
T
yml2213 e9a87194bd chore(douyin-mashida): 公网联调工具链(切地址 + 前置自检)
真实联调必须让平台能主动推到本机,所以需要隧道;这两个脚本把「配置切换」和
「联调前该验的东西」自动化,避免手工漏配(尤其 certLink 漏改、占位密钥没换):

- `douyin-mashida:set-public-url`:把 certLink/afterVerifyLink 切成隧道地址,
  打印平台侧要配的三项(message_url / topics / 卡券链接),并自检隧道:
  用错误签名打公网地址,期望 401 —— 证明「隧道 → Caddy → 后端 → 验签」通了,
  不需要密钥、也不产生真实订单
- `douyin-mashida:preflight`:四步自检
  ① 配置就绪度(含识别早期联调留下的占位密钥,它会让 hasSecret=true 骗过你)
  ② 真实网关连通性:平台是先校 uid 再校签名,带 --secret 时若平台报的不是
     签名错误即证明签名/密钥正确(正式推送前就能排掉密钥问题)
  ③ 公网回调可达性 ④ certLink 与公网域名是否一致
- 平台文档只给了 code=10000 表示成功,无完整错误码表,故脚本不翻译码值、
  只原样打印,并对实测观测到的码(如 10014)加说明

同时修掉 vite dev server 的一个潜在坑:`VITE_ALLOWED_HOSTS` 早已在 .env 与
compose 中配置,但 vite.config.ts 的白名单是硬编码的、从未读取该变量,
换隧道域名必然被 Vite 拦(Blocked request);现已真正接上并默认放行
常见隧道域名后缀。
2026-10-09 12:01:42 +08:00

59 lines
2.9 KiB
JSON

{
"name": "order-site-backend",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"cleanup:dev-data": "tsx scripts/cleanup-dev-data.ts",
"build": "tsc -p tsconfig.build.json && rm -rf dist/db/migrations && mkdir -p dist/db && cp -R src/db/migrations dist/db/migrations && mkdir -p dist/services/platforms/pdd && cp src/services/platforms/pdd/pdd_anti.cjs dist/services/platforms/pdd/pdd_anti.cjs",
"db:migrate": "tsx src/db/migrate.ts",
"db:migrate:create": "tsx scripts/create-migration.ts",
"db:migrate:status": "tsx scripts/migration-status.ts",
"storage:migrate": "tsx scripts/migrate-storage.ts",
"storage:migrate:built": "node dist/storage-migrate.js",
"check:sql": "tsx scripts/check-sql-guard.ts",
"dev": "tsx watch --clear-screen=false src/index.ts",
"format": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --write \"src/**/*.{ts,js,json}\" \"scripts/**/*.{ts,js}\" eslint.config.js package.json tsconfig.json tsconfig.build.json tsconfig.eslint.json",
"format:check": "prettier --config ../../.prettierrc.json --ignore-path ../../.prettierignore --check \"src/**/*.{ts,js,json}\" \"scripts/**/*.{ts,js}\" eslint.config.js package.json tsconfig.json tsconfig.build.json tsconfig.eslint.json",
"lint": "eslint \"src/**/*.ts\" \"scripts/**/*.ts\"",
"lint:check": "npm run lint -- --quiet",
"lint:fix": "npm run lint -- --fix",
"mock:open91": "tsx scripts/mock-open91-order.ts",
"douyin-mashida:set-public-url": "tsx scripts/douyin-mashida-set-public-url.ts",
"douyin-mashida:preflight": "tsx scripts/douyin-mashida-preflight.ts",
"test": "node --import tsx --test $(find src \\( -name '*.test.ts' -o -name '*.test.js' \\) -print)",
"test:industry": "tsx scripts/test-kuaishou-industry.ts",
"test:industry:http": "tsx scripts/test-kuaishou-industry-http.ts",
"test:industry:gen": "tsx scripts/gen-test-cases.ts",
"test:industry:curl": "tsx scripts/curl-send-callback.ts",
"typecheck": "tsc -p tsconfig.json --noEmit",
"check": "npm run format:check && npm run check:sql && npm run lint:check && npm run typecheck && npm test && npm run build",
"start": "node dist/index.js",
"start:src": "tsx src/index.ts"
},
"dependencies": {
"@alicloud/dysmsapi20170525": "^4.6.0",
"@alicloud/openapi-client": "^0.4.15",
"@alicloud/tea-util": "^1.4.11",
"@aws-sdk/client-s3": "^3.1116.0",
"express": "^5.1.0",
"multer": "^2.2.0",
"node-pg-migrate": "^8.0.4",
"pg": "^8.16.3",
"sharp": "^0.35.3"
},
"devDependencies": {
"@eslint/js": "10.0.1",
"@types/express": "^5.0.6",
"@types/multer": "^2.2.0",
"@types/node": "^25.6.0",
"@types/pg": "^8.20.0",
"eslint": "10.8.1",
"globals": "17.11.0",
"prettier": "3.8.3",
"tsx": "^4.22.3",
"typescript": "^6.0.2",
"typescript-eslint": "8.67.0"
}
}