- Add ioredis dependency for Redis connection pooling - Create RedisService singleton with connection management - Add Redis config (url, dedupWindowSeconds) to notification.config.ts - Implement NotificationService.checkRateLimit using Redis INCR+EXPIRE - Implement NotificationService.deduplicateNotification using Redis SET/NX - Add configurable rate limit windows and thresholds via env vars - Add 29 unit tests covering Redis operations, rate limiting, and dedup - All tests pass, TypeScript compiles cleanly for new files
29 lines
588 B
JSON
29 lines
588 B
JSON
{
|
|
"name": "@shieldai/shared-notifications",
|
|
"version": "1.0.0",
|
|
"main": "src/index.ts",
|
|
"types": "src/index.ts",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"lint": "eslint src/"
|
|
},
|
|
"dependencies": {
|
|
"resend": "^3.0.0",
|
|
"firebase-admin": "^12.0.0",
|
|
"twilio": "^4.0.0",
|
|
"zod": "^3.22.0",
|
|
"express": "^4.18.0",
|
|
"ioredis": "^5.4.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/express": "^4.17.0",
|
|
"typescript": "^5.0.0",
|
|
"vitest": "^4.1.5"
|
|
},
|
|
"peerDependencies": {
|
|
"typescript": "^5.0.0"
|
|
}
|
|
}
|