fix(15): WR-01 use shared getAutotaskClient factory in phishing-detector

This commit is contained in:
lorentz 2026-07-15 08:07:45 -04:00
parent ecc34b4bad
commit c875081275

View file

@ -14,7 +14,7 @@
import { createHash } from 'crypto';
import { postgresClient } from './postgres-client';
import { AutotaskClient } from './autotask-client';
import { getAutotaskClient } from './autotask-factory';
// =============================================================================
// Pure detection logic — pattern matcher + content hash
@ -109,19 +109,6 @@ export interface EvidencePayload {
attachments: EvidenceAttachment[];
}
let _autotaskClient: AutotaskClient | null = null;
function getAutotaskClient(): AutotaskClient {
if (!_autotaskClient) {
_autotaskClient = new AutotaskClient({
apiUrl: process.env.AUTOTASK_API_URL || '',
username: process.env.AUTOTASK_USERNAME || '',
password: process.env.AUTOTASK_SECRET || '',
apiIntegrationCode: process.env.AUTOTASK_API_INTEGRATION_CODE || '',
});
}
return _autotaskClient;
}
/**
* Gather EVID-01 evidence for a candidate ticket: company name, ticket notes,
* time entries, and attachment metadata (never base64 `data` content fetch