/** * HubSpot CRM Integration for WORKWAY * * Unified client for HubSpot CRM operations: Contacts, Companies, Deals. * Designed for meeting follow-up automation - update deal stages, * log meeting activities, and track engagement. * * @example * ```typescript * import { HubSpot } from '@workwayco/integrations/hubspot'; * * const hubspot = new HubSpot({ accessToken: tokens.hubspot.access_token }); * * // Search for a deal by name * const deals = await hubspot.searchDeals({ query: 'Acme Corp' }); * * // Update deal after meeting * await hubspot.updateDealFromMeeting({ * dealId: '123', * meetingTitle: 'Q4 Planning', * summary: 'Discussed roadmap...', * nextSteps: ['Send proposal', 'Schedule follow-up'], * }); * * // Log a meeting activity * await hubspot.logMeetingActivity({ * dealId: '123', * meetingTitle: 'Demo Call', * duration: 30, * notes: 'Showed product features...', * }); * ``` */ import { ActionResult } from '@workwayco/sdk'; import { BaseAPIClient } from '../core/index.js'; /** * HubSpot integration configuration */ export interface HubSpotConfig { /** OAuth access token */ accessToken: string; /** Optional: Override API endpoint (for testing) */ apiUrl?: string; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; } /** * HubSpot contact object */ export interface HubSpotContact { id: string; properties: { firstname?: string; lastname?: string; email?: string; phone?: string; company?: string; jobtitle?: string; [key: string]: string | undefined; }; createdAt: string; updatedAt: string; } /** * HubSpot company object */ export interface HubSpotCompany { id: string; properties: { name?: string; domain?: string; industry?: string; phone?: string; city?: string; state?: string; country?: string; [key: string]: string | undefined; }; createdAt: string; updatedAt: string; } /** * HubSpot deal object */ export interface HubSpotDeal { id: string; properties: { dealname?: string; dealstage?: string; amount?: string; closedate?: string; pipeline?: string; hubspot_owner_id?: string; description?: string; notes_last_updated?: string; [key: string]: string | undefined; }; createdAt: string; updatedAt: string; } /** * HubSpot engagement (activity) object */ export interface HubSpotEngagement { id: string; type: 'MEETING' | 'NOTE' | 'CALL' | 'EMAIL' | 'TASK'; timestamp: number; metadata: Record; associations: { contactIds?: string[]; companyIds?: string[]; dealIds?: string[]; }; } /** * Search options */ export interface SearchOptions { /** Search query */ query: string; /** Maximum results (default: 10) */ limit?: number; /** Properties to return */ properties?: string[]; } /** * Deal update options */ export interface UpdateDealOptions { /** Deal ID */ dealId: string; /** Properties to update */ properties: Record; } /** * Options for updating deal after a meeting * * Zuhandenheit: Outcome-focused interface * Developer thinks "update CRM after meeting" not "construct property object" */ export interface UpdateDealAfterMeetingOptions { /** Deal ID */ dealId: string; /** Meeting summary - what was discussed */ summary: string; /** * Meeting outcome - infers stage progression * - 'progressed': Move to next stage in pipeline * - 'stalled': Keep current stage, log concern * - 'closed-won': Move to closed-won * - 'closed-lost': Move to closed-lost */ outcome?: 'progressed' | 'stalled' | 'closed-won' | 'closed-lost'; /** Link to full notes (Notion, Google Doc, etc) */ notesUrl?: string; } /** * @deprecated Use UpdateDealAfterMeetingOptions instead * Legacy interface kept for backwards compatibility */ export interface UpdateDealFromMeetingOptions { /** Deal ID */ dealId: string; /** Meeting title */ meetingTitle: string; /** Meeting summary */ summary?: string; /** Action items from the meeting */ actionItems?: Array<{ task: string; assignee?: string; }>; /** Next steps */ nextSteps?: string[]; /** Move deal to this stage (optional) */ newStage?: string; /** Notion URL for full notes */ notionUrl?: string; } /** * Options for logging meeting activity */ export interface LogMeetingActivityOptions { /** Deal ID to associate with */ dealId?: string; /** Contact IDs to associate with */ contactIds?: string[]; /** Company ID to associate with */ companyId?: string; /** Meeting title */ meetingTitle: string; /** Meeting duration in minutes */ duration?: number; /** Meeting notes/summary */ notes?: string; /** Meeting start time (ISO string or timestamp) */ startTime?: string | number; /** External meeting URL (e.g., Notion page) */ externalUrl?: string; } /** * HubSpot CRM Integration * * Weniger, aber besser: Unified CRM client for meeting follow-up automation. */ export declare class HubSpot extends BaseAPIClient { constructor(config: HubSpotConfig); /** * Search for contacts */ searchContacts(options: SearchOptions): Promise>; /** * Get a contact by ID */ getContact(contactId: string): Promise>; /** * Get contact by email */ getContactByEmail(email: string): Promise>; /** * Search for companies */ searchCompanies(options: SearchOptions): Promise>; /** * Search for deals */ searchDeals(options: SearchOptions): Promise>; /** * Get a deal by ID */ getDeal(dealId: string): Promise>; /** * Update a deal */ updateDeal(options: UpdateDealOptions): Promise>; /** * Update deal after a meeting (Zuhandenheit API) * * Outcome-focused: Developer thinks "meeting went well, deal progressed" * not "PATCH description, lookup stage ID, format timestamp" * * @example * ```typescript * await hubspot.updateDealAfterMeeting({ * dealId: '123', * summary: 'Discussed Q4 roadmap, client approved budget', * outcome: 'progressed', * notesUrl: 'https://notion.so/meeting-notes/abc' * }); * ``` */ updateDealAfterMeeting(options: UpdateDealAfterMeetingOptions): Promise>; /** * @deprecated Use updateDealAfterMeeting instead * Legacy method kept for backwards compatibility */ updateDealFromMeeting(options: UpdateDealFromMeetingOptions): Promise>; /** * Log a meeting activity * * Creates a meeting engagement in HubSpot associated with deals, contacts, or companies. */ logMeetingActivity(options: LogMeetingActivityOptions): Promise>; /** * Get deal pipelines and stages */ getDealPipelines(): Promise; }>>>; /** * Get capabilities for HubSpot actions */ private getCapabilities; } //# sourceMappingURL=index.d.ts.map