mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-11 20:05:25 +00:00
* add deps * hook up dau from audit table to analytics page * add audit event for code nav * analytics dashboard * add changelog entry * add news entry * smaller video and news data nit * feedback
13 lines
No EOL
630 B
TypeScript
13 lines
No EOL
630 B
TypeScript
import { IAuditService } from '@/ee/features/audit/types';
|
|
import { MockAuditService } from '@/ee/features/audit/mockAuditService';
|
|
import { AuditService } from '@/ee/features/audit/auditService';
|
|
import { hasEntitlement } from '@sourcebot/shared';
|
|
import { env } from '@/env.mjs';
|
|
|
|
let enterpriseService: IAuditService | undefined;
|
|
|
|
export function getAuditService(): IAuditService {
|
|
const auditLogsEnabled = (env.SOURCEBOT_EE_AUDIT_LOGGING_ENABLED === 'true') && hasEntitlement("audit");
|
|
enterpriseService = enterpriseService ?? (auditLogsEnabled ? new AuditService() : new MockAuditService());
|
|
return enterpriseService;
|
|
} |