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