Files
SnapOtter/apps/api/package.json
T
SnapOtterandGitHub bf417a509e fix: first-run QA sweep of the single-container image (#413)
Fixes found by manually testing a fresh install end to end:

- auth: the must-change-password gate returned 403 on public routes
  including /api/v1/health, so every fresh install showed a false
  "Reconnecting to server" banner on the forced password change
  screen. Public routes are now exempt (they need no session at all).
  Adds the gate's first direct tests.
- multipart: @fastify/multipart's parts() iterator (9.4.0 and 10.0.0)
  ends on the request stream's "close", which on a reused keep-alive
  connection fires while an earlier part is still streaming to storage,
  silently dropping the parts behind it. The object eraser lost its
  mask file on every second POST per connection. Replaced with a
  busboy-driven iterator (lib/multipart-parts.ts) that ends on busboy's
  own "finish", installed for all routes via a preValidation hook;
  the tool-factory field-recovery workaround for the same bug is now
  unnecessary and removed.
- eraser: the mask canvas backing store is natural resolution, but
  "absolute inset-0" does not stretch replaced elements, so the
  canvas rendered at intrinsic size and the brush ring, strokes, and
  exported mask were all misscaled on photos larger than the viewport.
  The canvas now gets an explicit CSS box at the fitted size.
- compare slider: solid white divider with a dark halo so it stays
  visible over light images; still initialised at the painted region.
- tool page: the AI bundle install prompt now centers in the content
  area instead of hugging the top.
- api docs: disabled Scalar's cloud features (Ask AI, Generate MCP,
  Open API Client, dev toolbar), hid the "Powered by Scalar" footer
  link, and set the page title to "SnapOtter API Reference". The docs
  CSP blocks those cloud calls by design, so the buttons were dead UI.
- docker: embedded Redis comes from packages.redis.io pinned to the
  8.x major (was Debian's 7.0.15), matching the Compose stack and the
  documented claim. Build fails fast if the major ever drifts.
- docs: DOCKERHUB.md quick start now leads with the one-command docker
  run (matching the README) with Compose as the production path;
  README says embedded Postgres 17 + Redis 8.

Claude-Session: https://claude.ai/code/session_01XGB4pGvTvb7sUX4JN745U7
2026-07-03 19:32:25 +08:00

97 lines
3.0 KiB
JSON

{
"name": "@snapotter/api",
"version": "2.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "PORT=13490 tsx watch --import ./src/tracing.ts --import ./src/instrument.ts src/index.ts",
"build": "tsc",
"start": "tsx --import ./src/tracing.ts --import ./src/instrument.ts src/index.ts",
"lint": "biome check src/",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist",
"migrate:sqlite": "tsx src/db/migrate-from-sqlite.ts"
},
"dependencies": {
"@fastify/busboy": "^3.2.0",
"@fastify/cookie": "^11.0.2",
"@fastify/cors": "^11.0.0",
"@fastify/multipart": "^9.0.0",
"@fastify/rate-limit": "^10.2.0",
"@fastify/static": "^9.1.3",
"@neplex/vectorizer": "^0.1.0",
"@node-saml/node-saml": "^5.1.0",
"@opentelemetry/api": "^1.9.1",
"@opentelemetry/exporter-trace-otlp-http": "^0.219.0",
"@opentelemetry/instrumentation-aws-sdk": "^0.74.0",
"@opentelemetry/instrumentation-fastify": "^0.57.0",
"@opentelemetry/instrumentation-http": "^0.219.0",
"@opentelemetry/instrumentation-ioredis": "^0.67.0",
"@opentelemetry/instrumentation-pg": "^0.71.0",
"@opentelemetry/resources": "^2.8.0",
"@opentelemetry/sdk-node": "^0.219.0",
"@opentelemetry/sdk-trace-base": "^2.8.0",
"@opentelemetry/semantic-conventions": "^1.41.1",
"@scalar/fastify-api-reference": "^1.62.0",
"@sentry/node": "^10.62.0",
"@snapotter/ai": "workspace:*",
"@snapotter/doc-engine": "workspace:*",
"@snapotter/enterprise": "workspace:*",
"@snapotter/image-engine": "workspace:*",
"@snapotter/media-engine": "workspace:*",
"@snapotter/shared": "workspace:*",
"archiver": "^7.0.1",
"better-sqlite3": "^11.7.0",
"bullmq": "^5.79.2",
"bwip-js": "^4.11.1",
"dotenv": "^16.4.0",
"drizzle-orm": "^0.45.2",
"exceljs": "^4.4.0",
"exif-reader": "^2.0.3",
"fast-xml-parser": "^5.9.3",
"fastify": "^5.9.0",
"fflate": "^0.8.3",
"ioredis": "^5.11.1",
"ipaddr.js": "^2.4.0",
"js-yaml": "^4.3.0",
"mupdf": "^1.27.0",
"openid-client": "^6.8.4",
"opentype.js": "^2.0.0",
"otpauth": "^9.5.1",
"p-queue": "^9.3.0",
"papaparse": "^5.5.4",
"pdfkit": "^0.19.1",
"pg": "^8.22.0",
"pino": "^10.3.1",
"pino-roll": "^4.0.0",
"playwright": "^1.61.1",
"posthog-node": "^5.38.6",
"potrace": "^2.1.8",
"prom-client": "^15.1.3",
"qrcode": "^1.5.4",
"sharp": "^0.35.2",
"tar": "^7.5.19",
"tsx": "^4.22.4",
"yauzl": "^3.4.0",
"zod": "^3.24.0",
"zxing-wasm": "^3.1.0"
},
"devDependencies": {
"@types/archiver": "^7.0.0",
"@types/better-sqlite3": "^7.6.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^22.20.0",
"@types/opentype.js": "^1.3.10",
"@types/papaparse": "^5.5.2",
"@types/pdfkit": "^0.17.6",
"@types/pg": "^8.20.0",
"@types/potrace": "^2.1.5",
"@types/qrcode": "^1.5.6",
"@types/tar": "^7.0.87",
"@types/yauzl": "^3.4.0",
"drizzle-kit": "^0.31.0",
"typescript": "^5.7.0"
},
"license": "AGPL-3.0"
}