import { GHLClient, GHLClientConfig } from './client'; import { GHLAgencyClient, AgencyClientConfig } from './agency-client'; import { ContactsService } from './services/contacts'; import { ConversationsService } from './services/conversations'; import { OpportunitiesService, PipelinesService } from './services/opportunities'; import { WorkflowsService } from './services/workflows'; import { CustomFieldsService } from './services/custom-fields'; import { LocationsService } from './services/locations'; export * from './client'; export * from './agency-client'; export * from './errors'; export type { CustomValue } from './services/custom-fields'; export * from './services/locations'; export * from './services/user-provisioning'; export * from './services/workflows'; export * from './services/admin-tagging'; export { adminTaggingService } from './services/admin-tagging'; // Full GHL client with all services export class GHL { private client: GHLClient; public contacts: ContactsService; public conversations: ConversationsService; public opportunities: OpportunitiesService; public pipelines: PipelinesService; public workflows: WorkflowsService; public customFields: CustomFieldsService; constructor(config: GHLClientConfig) { this.client = new GHLClient(config); this.contacts = new ContactsService(this.client); this.conversations = new ConversationsService(this.client); this.opportunities = new OpportunitiesService(this.client); this.pipelines = new PipelinesService(this.client); this.workflows = new WorkflowsService(this.client); this.customFields = new CustomFieldsService(this.client, config.locationId); } get locationId() { return this.client.locationID; } } // Factory function to create GHL client for a user export async function createGHLClientForUser(userId: string): Promise { // This will be implemented to fetch user's GHL credentials from database // For now, throw an error indicating it needs implementation throw new Error('createGHLClientForUser not yet implemented - needs database integration'); } // Factory function for agency-level operations export function createAgencyClient(config: AgencyClientConfig): GHLAgencyClient { return new GHLAgencyClient(config); }