- 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
93 lines
2.1 KiB
TypeScript
93 lines
2.1 KiB
TypeScript
// ============================================
|
|
// Consolidated @shieldai/db package
|
|
// ============================================
|
|
// Merges functionality from:
|
|
// - @shieldai/db (Prisma v6.2.0, FieldEncryptionService)
|
|
// - @shieldsai/shared-db (singleton pattern, type exports)
|
|
// ============================================
|
|
|
|
import { PrismaClient } from '@prisma/client';
|
|
import { FieldEncryptionService } from './services/field-encryption.service';
|
|
|
|
// ============================================
|
|
// Singleton Pattern (from shared-db)
|
|
// ============================================
|
|
const globalForPrisma = globalThis as unknown as {
|
|
prisma: PrismaClient | undefined;
|
|
};
|
|
|
|
export const prisma =
|
|
globalForPrisma.prisma ??
|
|
new PrismaClient({
|
|
log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
|
|
});
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
globalForPrisma.prisma = prisma;
|
|
}
|
|
|
|
export default prisma;
|
|
|
|
// ============================================
|
|
// Services (from @shieldai/db)
|
|
// ============================================
|
|
export { FieldEncryptionService };
|
|
|
|
// ============================================
|
|
// Type Exports (from shared-db)
|
|
// ============================================
|
|
export type {
|
|
User,
|
|
Account,
|
|
Session,
|
|
FamilyGroup,
|
|
FamilyGroupMember,
|
|
Subscription,
|
|
WatchlistItem,
|
|
PropertyWatchlistItem,
|
|
PropertySnapshot,
|
|
PropertyChange,
|
|
Exposure,
|
|
Alert,
|
|
VoiceEnrollment,
|
|
VoiceAnalysis,
|
|
AnalysisJob,
|
|
AnalysisResult,
|
|
SpamFeedback,
|
|
SpamRule,
|
|
AuditLog,
|
|
KPISnapshot,
|
|
SecurityReport,
|
|
WaitlistEntry,
|
|
BlogPost,
|
|
InfoBroker,
|
|
RemovalRequest,
|
|
BrokerListing,
|
|
UserRole,
|
|
FamilyMemberRole,
|
|
SubscriptionTier,
|
|
SubscriptionStatus,
|
|
WatchlistType,
|
|
PropertyChangeType,
|
|
PropertyChangeSeverity,
|
|
ExposureSource,
|
|
ExposureSeverity,
|
|
AlertType,
|
|
AlertSeverity,
|
|
AlertChannel,
|
|
FeedbackType,
|
|
RuleType,
|
|
RuleAction,
|
|
ReportType,
|
|
ReportStatus,
|
|
RemovalStatus,
|
|
RemovalMethod,
|
|
BrokerCategory,
|
|
AnalysisType,
|
|
AnalysisJobStatus,
|
|
DetectionVerdict,
|
|
} from '@prisma/client';
|
|
|
|
export * as PrismaModels from '@prisma/client';
|
|
export type { PrismaClient };
|