Fix FRE-5402: Add missing @shieldai/removebrokers dependency and fix compilation blockers
- Add @shieldai/removebrokers workspace dependency to API package.json - Fix misleading error message: 'Admin access required' -> 'Support access required' - Export RemovalRequest, InfoBroker, BrokerListing types from @shieldai/db - Export RemovalStatus, RemovalMethod, BrokerCategory enums from @shieldai/db - Fix BrokerAlertPipeline: correlationPipeline -> correlationService.ingestGenericAlert - Add @shieldai/correlation dependency to removebrokers package - Fix removalUrl null vs undefined type mismatch in RemoveBrokersService - Fix shared-billing package.json typo: @shieldsai -> @shieldai for shared-notifications
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"lint": "eslint src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@shieldai/correlation": "workspace:*",
|
||||
"@shieldai/db": "workspace:*",
|
||||
"@shieldai/types": "workspace:*",
|
||||
"@shieldai/shared-notifications": "workspace:*",
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user