feat: real-time alerts via WebSocket push notifications
- Add ws WebSocket server (port 3001) with JWT auth and user-socket mapping - Add WebSocket client with exponential backoff reconnection and heartbeat - Add useRealtimeAlerts hook with toast notifications and unread badge - Add alert.publisher service (WS → push → email fallback) - Integrate publisher into DarkWatch, VoicePrint, HomeTitle, SpamShield, RemoveBrokers - Update Navbar with connection status indicator and unread count - Add comprehensive tests (14 passing) for server, client, and publisher
This commit is contained in:
@@ -20,17 +20,18 @@ export const spamshieldRouter = createTRPCRouter({
|
||||
|
||||
classifySMS: publicProcedure
|
||||
.input(wrap(ClassifySMSSchema))
|
||||
.query(async ({ input }) => {
|
||||
return spamshieldService.classifySMS(input.text);
|
||||
.query(async ({ input, ctx }) => {
|
||||
return spamshieldService.classifySMS(input.text, ctx.user?.id);
|
||||
}),
|
||||
|
||||
classifyCall: publicProcedure
|
||||
.input(wrap(ClassifyCallSchema))
|
||||
.query(async ({ input }) => {
|
||||
.query(async ({ input, ctx }) => {
|
||||
return spamshieldService.classifyCall(
|
||||
input.callerNumber,
|
||||
input.duration,
|
||||
input.timeOfDay,
|
||||
ctx.user?.id,
|
||||
);
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user