rybbit/server/package.json
Bill Yang 42480f14fb Enhance analytics API with SQL string handling and validation improvements
- Added `sqlstring` package for safer SQL query construction across various analytics endpoints.
- Updated `getFunnel`, `getUserSessionCount`, and other functions to utilize `SqlString.escape` for parameterized inputs, enhancing security against SQL injection.
- Refactored input validation by replacing the `sql-sanitization` module with a new `query-validation` module, improving clarity and maintainability of parameter handling.
- Removed the deprecated `sql-sanitization.ts` file to streamline the codebase.
2025-04-25 15:37:27 -07:00

51 lines
1.5 KiB
JSON

{
"name": "analytics-backend",
"version": "1.0.0",
"description": "Self-hosted analytics backend using ClickHouse",
"main": "dist/index.js",
"type": "module",
"scripts": {
"dev": "tsc && node dist/index.js",
"build": "tsc",
"start": "node dist/index.js",
"db:generate": "drizzle-kit generate --config=drizzle.config.ts",
"db:migrate": "drizzle-kit migrate --config=drizzle.config.ts",
"db:push": "drizzle-kit push --config=drizzle.config.ts",
"db:pull": "drizzle-kit pull --config=drizzle.config.ts",
"db:drop": "drizzle-kit drop --config=drizzle.config.ts",
"db:check": "drizzle-kit check --config=drizzle.config.ts"
},
"dependencies": {
"@better-auth/stripe": "^1.2.7",
"@clickhouse/client": "^1.10.1",
"@fastify/cors": "^10.0.2",
"@fastify/one-line-logger": "^1.4.0",
"@fastify/static": "^8.0.4",
"@maxmind/geoip2-node": "^6.0.0",
"better-auth": "^1.2.7",
"dotenv": "^16.4.7",
"drizzle-orm": "^0.40.0",
"fastify": "^5.1.0",
"fastify-better-auth": "^1.0.1",
"luxon": "^3.5.0",
"node-cron": "^3.0.3",
"pg": "^8.13.3",
"postgres": "^3.4.5",
"sqlstring": "^2.3.3",
"stripe": "^17.7.0",
"ua-parser-js": "^2.0.0",
"undici": "^7.3.0",
"zod": "^3.24.3"
},
"devDependencies": {
"@types/luxon": "^3.4.2",
"@types/node": "^20.10.0",
"@types/node-cron": "^3.0.11",
"@types/pg": "^8.11.11",
"@types/sqlstring": "^2.3.2",
"drizzle-kit": "^0.30.5",
"ts-node-dev": "^2.0.0",
"tsx": "^4.19.3",
"typescript": "^5.7.3"
}
}