diff --git a/packages/api/package.json b/packages/api/package.json index d81c6f3..5e3749d 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -9,23 +9,28 @@ "test:coverage": "vitest run --coverage", "lint": "eslint src/" }, - "dependencies": { + "dependencies": { "@fastify/cors": "^10.0.1", "@fastify/helmet": "^13.0.1", "@fastify/multipart": "^7.7.3", "@fastify/rate-limit": "^9.0.0", "@fastify/sensible": "^6.0.1", + "fastify-raw-body": "^5.0.0", + "@fastify/swagger": "^9.4.0", + "@fastify/swagger-ui": "^5.2.0", "@shieldai/correlation": "workspace:*", - "@shieldai/darkwatch": "workspace:*", "@shieldai/db": "workspace:*", "@shieldai/monitoring": "workspace:*", + "@shieldai/removebrokers": "workspace:*", "@shieldai/report": "workspace:*", + "@shieldsai/shared-auth": "workspace:*", "@shieldai/shared-notifications": "workspace:*", "@shieldai/types": "workspace:*", "@shieldai/voiceprint": "workspace:*", "bullmq": "^5.24.0", "fastify": "^5.2.0", - "ioredis": "^5.4.0" + "ioredis": "^5.4.0", + "jsonwebtoken": "^9.0.2" }, "devDependencies": { "@vitest/coverage-v8": "^4.1.5", diff --git a/packages/api/src/routes/removebrokers.routes.ts b/packages/api/src/routes/removebrokers.routes.ts index 6f7d519..dbec451 100644 --- a/packages/api/src/routes/removebrokers.routes.ts +++ b/packages/api/src/routes/removebrokers.routes.ts @@ -1,6 +1,7 @@ import { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'; import { prisma } from '@shieldai/db'; import { RemovalStatus, Severity, AlertCategory, EntityTypes } from '@shieldai/types'; +import type { RemovalStatus as PrismaRemovalStatus } from '@shieldai/db'; import { removeBrokersService, removeBrokersScheduler, @@ -313,7 +314,7 @@ export async function removebrokersRoutes(fastify: FastifyInstance) { await prisma.removalRequest.update({ where: { id }, - data: { status: RemovalStatus.CANCELLED }, + data: { status: RemovalStatus.CANCELLED as PrismaRemovalStatus }, }); return reply.send({ @@ -336,7 +337,7 @@ export async function removebrokersRoutes(fastify: FastifyInstance) { } if (authReq.user.role !== 'support') { - return reply.code(403).send({ error: 'Admin access required' }); + return reply.code(403).send({ error: 'Support access required' }); } try { diff --git a/packages/db/src/index.ts b/packages/db/src/index.ts index c537d46..d0edf33 100644 --- a/packages/db/src/index.ts +++ b/packages/db/src/index.ts @@ -44,6 +44,9 @@ export type { FamilyGroupMember, Subscription, WatchlistItem, + PropertyWatchlistItem, + PropertySnapshot, + PropertyChange, Exposure, Alert, VoiceEnrollment, @@ -57,11 +60,16 @@ export type { SecurityReport, WaitlistEntry, BlogPost, + InfoBroker, + RemovalRequest, + BrokerListing, UserRole, FamilyMemberRole, SubscriptionTier, SubscriptionStatus, WatchlistType, + PropertyChangeType, + PropertyChangeSeverity, ExposureSource, ExposureSeverity, AlertType, @@ -72,6 +80,9 @@ export type { RuleAction, ReportType, ReportStatus, + RemovalStatus, + RemovalMethod, + BrokerCategory, AnalysisType, AnalysisJobStatus, DetectionVerdict, diff --git a/packages/shared-billing/package.json b/packages/shared-billing/package.json index 27a8a01..f8a9b07 100644 --- a/packages/shared-billing/package.json +++ b/packages/shared-billing/package.json @@ -9,6 +9,8 @@ "lint": "eslint src/" }, "dependencies": { + "@shieldsai/shared-db": "workspace:*", + "@shieldai/shared-notifications": "workspace:*", "express": "^4.22.1", "stripe": "^14.25.0", "zod": "^3.25.76" diff --git a/services/removebrokers/package.json b/services/removebrokers/package.json index ca7f848..766d627 100644 --- a/services/removebrokers/package.json +++ b/services/removebrokers/package.json @@ -10,6 +10,7 @@ "lint": "eslint src/" }, "dependencies": { + "@shieldai/correlation": "workspace:*", "@shieldai/db": "workspace:*", "@shieldai/types": "workspace:*", "@shieldai/shared-notifications": "workspace:*", diff --git a/services/removebrokers/src/BrokerAlertPipeline.ts b/services/removebrokers/src/BrokerAlertPipeline.ts index 25629fd..dc2ec45 100644 --- a/services/removebrokers/src/BrokerAlertPipeline.ts +++ b/services/removebrokers/src/BrokerAlertPipeline.ts @@ -57,8 +57,8 @@ export class BrokerAlertPipeline { private async normalizeAndSend(alert: NormalizedAlertInput) { try { - const { correlationPipeline } = await import("@shieldai/correlation"); - return correlationPipeline.normalizeAlert(alert); + const { correlationService } = await import("@shieldai/correlation"); + return correlationService.ingestGenericAlert(alert); } catch { console.error("[BrokerAlert] Failed to send alert:", alert.sourceAlertId); return alert; diff --git a/services/removebrokers/src/RemoveBrokersService.ts b/services/removebrokers/src/RemoveBrokersService.ts index ba39620..61ce990 100644 --- a/services/removebrokers/src/RemoveBrokersService.ts +++ b/services/removebrokers/src/RemoveBrokersService.ts @@ -236,7 +236,7 @@ export class RemoveBrokersService { throw new Error(`Invalid personal info in request ${requestId}`); } const stillListed = await this.checkBrokerListing( - request.broker, + { ...request.broker, removalUrl: request.broker.removalUrl || undefined }, personalInfo, );